Closed guidopetri closed 4 years ago
I agree with subclassing from a generic Game
class. Some functions I was thinking could be useful for this class:
GetInitialBoard() -> array/tensor (board)
GetLegalMoves(current_player (int?), current_board (array/tensor)) -> Array[Bool]
MakeMove(move (int/binary array?), board (array/tensor)) -> board (array/tensor)'
IsFinal(board) -> Bool, int (-1,0,1)
Another thing that could be useful is to handle different settings for the same game by having to initiate an object with certain settings to "use" the game, i.e. the methods wouldn't be static, e.g.:
connect4_big = Connect4(width = 10, height = 8, winning_len = 5)
Working on this in #8 . The game itself is there, but I'm writing tests for it too.
Closed through #8 .
For future-proofing our code, and to start out with tic-tac-toe, we should have a game class that implements things like getting all possible moves, as well as win conditions, for instance.
The reason why we should do this as a class is so that we can easily pass in other games to our NN architecture. Maybe tic-tac-toe should be a subclass of a more general
Game
class that leaves implementation of specific methods for the subclasses? That way all our games can subclassGame
and we can ensure that the games are all implemented fully.