ASPP / pelita_template

Default template to get started with the Pelita game.
3 stars 25 forks source link

State as an arg #9

Closed otizonaizit closed 5 years ago

otizonaizit commented 6 years ago

Implementation of the third alternative for a new state object and removal of the Game object and the Team list from: https://github.com/ASPP/pelita/issues/529

The code is so much nicer to write, and in general shorter and more straightforward. A clear win.

I have explicitly declared the next_move variable even within the most trivial move functions, so that it is clear that the function now returns a tuple with two elements, the first is a move and the second the new state object.

I adapted the documentation too. It reads also more easily.

Note that changes to setup_test_game in pelita are also required for this to work (see the test_demoX.py files).

In the documentation I say that doing print(bot) wil print the state of the game. I think this should include the layout string and all other relevant info, for example score, round, etc...

otizonaizit commented 5 years ago

Merging this now that we have the new API in pelita. Still an open issue (will open issue on pelita for this)