Pente game made for school, feel free to use.
Properties:
Board Example:
[['1', '0', '1', '0', '1', '1', '0', '1', '0', '1'], \
['.', '.', '.', '.', '.', '.', '.', '.', '.', '.'], \
['0', '.', '1', '.', '.', '0', '.', '1', '.', '.'], \
['.', '.', '.', '.', '1', '.', '.', '.', '.', '1'], \
['.', '.', '1', '0', '.', '.', '.', '1', '0', '.'], \
['1', '0', '1', '0', '1', '1', '0', '1', '0', '1'], \
['.', '.', '.', '.', '.', '.', '.', '.', '.', '.'], \
['0', '.', '1', '.', '.', '0', '.', '1', '.', '.'], \
['.', '.', '.', '.', '1', '.', '.', '.', '.', '1'], \
['.', '.', '1', '0', '.', '.', '.', '1', '0', '.']]
Draw a the board in pygame screen, should be call in a loop.
Returns empty board.
Validates a move.
Check if the move can capture pieces and deletes the captured pieces.
Saves the move to self.board
Checks if self.board is full
Check if a player won.
Randomize the start (Return 'blue' or 'green')
Function to call when user makes click
Get Mouse coordinates relative to the board.
Properties:
Makes the object printable.