Othello

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "led_func.h"
00002 #include "othellomain.h"
00003 
00004 Ticker LedBoard;
00005 
00006 void SetLEDBoard(Board board){
00007     for(uint8_t i=0;i<8;i++){
00008         for(uint8_t j=0;j<8;j++){
00009             if(board.board[i][j]==BLACK)led_board[i][j].SetColor(CBLUE);
00010             if(board.board[i][j]==WHITE)led_board[i][j].SetColor(CGREEN);
00011         }
00012     }
00013 }
00014 
00015 int main(){
00016     ResetLEDBoard();
00017     RandomAI player1(BLACK);
00018     RandomAI player2(WHITE);
00019     Board mainboard;
00020     LedBoard.attach_us(&PrintLEDBoard,100);
00021     Play(player1,player2,mainboard);
00022     while(1){}
00023 }