tpemartin / 112-2-programming-for-economic-modeling

MIT License
0 stars 1 forks source link

Exercise: Game Room #20

Open tpemartin opened 12 months ago

tpemartin commented 12 months ago

Add proper method to Game and Player classes from (games.py) so that

game.create_room(room_id = "r-1")
player1.join_room(room_id = "r-1")

works as it should.

tpemartin commented 12 months ago

For game.create_room()

Resource import

https://github.com/tpemartin/gamepy/blob/5ba38426f94ca8a19e46c8fc6cf3e0b7f5e1c6a9/games.py#L2-L5

Under Game class:

https://github.com/tpemartin/gamepy/blob/5ba38426f94ca8a19e46c8fc6cf3e0b7f5e1c6a9/games.py#L57C1-L58C35

helpers

https://github.com/tpemartin/gamepy/blob/5ba38426f94ca8a19e46c8fc6cf3e0b7f5e1c6a9/games.py#L87-L89

tpemartin commented 12 months ago

https://github.com/tpemartin/gamepy/blob/main/games.py

tpemartin commented 12 months ago

For Player

https://github.com/tpemartin/gamepy/commit/161d47aa73750fd2353e3c720babeb5007a3ce0b

tpemartin commented 12 months ago

For two players

https://github.com/tpemartin/gamepy/commit/fc52ee4b66c77910364e7c3f7c953b3121457f3b

https://github.com/tpemartin/gamepy/commit/d0a8a6ff637a2a5c182610deb7768ec688552e79

tpemartin commented 12 months ago

Final reference answer:

https://github.com/tpemartin/gamepy/blob/d0a8a6ff637a2a5c182610deb7768ec688552e79/games.py