Skip to content

Commit bc3da94

Browse files
committed
first draft of wahoot w5
1 parent 809ee12 commit bc3da94

File tree

1 file changed

+62
-8
lines changed

1 file changed

+62
-8
lines changed

week5/w5_wahoot.ipynb

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,40 +28,94 @@
2828
"cell_type": "markdown",
2929
"metadata": {},
3030
"source": [
31-
"## Wahoot Project: Reading and writing games to/from disk"
31+
"## Wahoot Project: Persistent Game History"
3232
]
3333
},
3434
{
3535
"cell_type": "markdown",
3636
"metadata": {},
3737
"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."
4139
]
4240
},
4341
{
4442
"cell_type": "markdown",
4543
"metadata": {},
4644
"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)***"
48102
]
49103
}
50104
],
51105
"metadata": {
52106
"kernelspec": {
53-
"display_name": "Python 3.10.2 64-bit",
107+
"display_name": "Python 3.10.6 64-bit",
54108
"language": "python",
55109
"name": "python3"
56110
},
57111
"language_info": {
58112
"name": "python",
59-
"version": "3.10.2"
113+
"version": "3.10.6"
60114
},
61115
"orig_nbformat": 4,
62116
"vscode": {
63117
"interpreter": {
64-
"hash": "9e7342ba0ab402af88d570c19a0b1c8a8c78f2edbd6d0204fb59a98d1c2d2ef0"
118+
"hash": "7c57092efe4ff60dfd9ba12cd3127c3cb8001227526172b4b54478afc6e523e7"
65119
}
66120
}
67121
},

0 commit comments

Comments
 (0)