Othello
Dependencies: mbed
Diff: othellomain.h
- Revision:
- 0:8c7f841516ab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/othellomain.h Tue Sep 04 04:07:41 2018 +0000 @@ -0,0 +1,25 @@ +#include "player.h" + +void Play(RandomAI player1,RandomAI player2,Board board){ + uint8_t put_move; + while(1){ + SetLEDBoard(board); + if(GameSet(board))break; + led_board[15][14].red=255; + if(board.turn==player1.color){ + led_board[14][14].red=255; + put_move=player1.PutMove(board); + board.SetBoard(PutStone(board,put_move/8,put_move%8,player1.color).board); + if(GetPutCoords(board,player2.color).size()!=0)board.turn=-board.turn; + } + SetLEDBoard(board); + if(GameSet(board))break; + if(board.turn==player2.color){ + led_board[13][13].red=255; + put_move=player2.PutMove(board); + board.SetBoard(PutStone(board,put_move/8,put_move%8,player2.color).board); + if(GetPutCoords(board,player1.color).size()!=0)board.turn=-board.turn; + } + } + led_board[15][15].red=255; +} \ No newline at end of file