|
28 | 28 | "cell_type": "markdown",
|
29 | 29 | "metadata": {},
|
30 | 30 | "source": [
|
31 |
| - "## Wahoot Project: Reading and writing games to/from disk" |
| 31 | + "## Wahoot Project: Persistent Game History" |
32 | 32 | ]
|
33 | 33 | },
|
34 | 34 | {
|
35 | 35 | "cell_type": "markdown",
|
36 | 36 | "metadata": {},
|
37 | 37 | "source": [
|
38 |
| - "This week, we'd like you to:\n", |
39 |
| - "\n", |
40 |
| - "- TBD." |
| 38 | + "Good morning/afternoon/evening/night! It's Week 5, and that means we've got something class-related to implement." |
41 | 39 | ]
|
42 | 40 | },
|
43 | 41 | {
|
44 | 42 | "cell_type": "markdown",
|
45 | 43 | "metadata": {},
|
46 | 44 | "source": [
|
47 |
| - "🖋️ ***Written by Tomas from the [AI Society](https://warwick.ai)***" |
| 45 | + "This week, we'll be extending the `GameHistory` class (in `repositories.py`) to support saving and loading the information it stores. We'll also need to identify places within the game logic where it would be best to call these methods. This week is a bit more open-ended than usual (we're all adults here), but we'll still give some guidance on the steps involved." |
| 46 | + ] |
| 47 | + }, |
| 48 | + { |
| 49 | + "cell_type": "markdown", |
| 50 | + "metadata": {}, |
| 51 | + "source": [ |
| 52 | + "### Saving" |
| 53 | + ] |
| 54 | + }, |
| 55 | + { |
| 56 | + "cell_type": "markdown", |
| 57 | + "metadata": {}, |
| 58 | + "source": [ |
| 59 | + "> Task 1: Implement a `save(self, file_name)` method for the `GameHistory` class, which should take all of the relevant game information and store it in one (or multiple) files. We'd recommend a CSV format, but you could choose JSON (if you know how it works) or even a custom format of your own! The important part is that you'll be able to extract the data later." |
| 60 | + ] |
| 61 | + }, |
| 62 | + { |
| 63 | + "cell_type": "markdown", |
| 64 | + "metadata": {}, |
| 65 | + "source": [ |
| 66 | + "> Task 2: Find an appropriate place to call the `history.save(file_name)` method within either `Game` or `Player`. Would you want to do it after every question? After a player finishes answering all the questions in a game? Something else? The choice is yours." |
| 67 | + ] |
| 68 | + }, |
| 69 | + { |
| 70 | + "cell_type": "markdown", |
| 71 | + "metadata": {}, |
| 72 | + "source": [ |
| 73 | + "### Loading" |
| 74 | + ] |
| 75 | + }, |
| 76 | + { |
| 77 | + "cell_type": "markdown", |
| 78 | + "metadata": {}, |
| 79 | + "source": [ |
| 80 | + "> Task 3: Implement a `load(self, file_name)` method for the `GameHistory` class, which should read from your file created by `save()` and populate the data stored by the class. The difficulty of this task depends on your chosen format for Task 1." |
| 81 | + ] |
| 82 | + }, |
| 83 | + { |
| 84 | + "cell_type": "markdown", |
| 85 | + "metadata": {}, |
| 86 | + "source": [ |
| 87 | + "> Task 4: Find an appropriate place to call the `history.save(file_name)` method. It might be closer than you think." |
| 88 | + ] |
| 89 | + }, |
| 90 | + { |
| 91 | + "cell_type": "markdown", |
| 92 | + "metadata": {}, |
| 93 | + "source": [ |
| 94 | + "*To be clear: we don't expect you to complete all of these tasks within the Workshop - you can generally consider Wahoot to be more of an extension compared to the main exercises, that you can develop a cool project out of.*" |
| 95 | + ] |
| 96 | + }, |
| 97 | + { |
| 98 | + "cell_type": "markdown", |
| 99 | + "metadata": {}, |
| 100 | + "source": [ |
| 101 | + "🖋️ ***Written by Keegan from the [Computing Society](https://uwcs.co.uk)***" |
48 | 102 | ]
|
49 | 103 | }
|
50 | 104 | ],
|
51 | 105 | "metadata": {
|
52 | 106 | "kernelspec": {
|
53 |
| - "display_name": "Python 3.10.2 64-bit", |
| 107 | + "display_name": "Python 3.10.6 64-bit", |
54 | 108 | "language": "python",
|
55 | 109 | "name": "python3"
|
56 | 110 | },
|
57 | 111 | "language_info": {
|
58 | 112 | "name": "python",
|
59 |
| - "version": "3.10.2" |
| 113 | + "version": "3.10.6" |
60 | 114 | },
|
61 | 115 | "orig_nbformat": 4,
|
62 | 116 | "vscode": {
|
63 | 117 | "interpreter": {
|
64 |
| - "hash": "9e7342ba0ab402af88d570c19a0b1c8a8c78f2edbd6d0204fb59a98d1c2d2ef0" |
| 118 | + "hash": "7c57092efe4ff60dfd9ba12cd3127c3cb8001227526172b4b54478afc6e523e7" |
65 | 119 | }
|
66 | 120 | }
|
67 | 121 | },
|
|
0 commit comments