Othello
Dependencies: mbed
player.h@0:8c7f841516ab, 2018-09-04 (annotated)
- Committer:
- Yuto_K
- Date:
- Tue Sep 04 04:07:41 2018 +0000
- Revision:
- 0:8c7f841516ab
Othello;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Yuto_K | 0:8c7f841516ab | 1 | #include "othello.h" |
Yuto_K | 0:8c7f841516ab | 2 | |
Yuto_K | 0:8c7f841516ab | 3 | /*class Player{ |
Yuto_K | 0:8c7f841516ab | 4 | public: |
Yuto_K | 0:8c7f841516ab | 5 | int8_t color; |
Yuto_K | 0:8c7f841516ab | 6 | Player(int8_t color){ |
Yuto_K | 0:8c7f841516ab | 7 | this->color=color; |
Yuto_K | 0:8c7f841516ab | 8 | } |
Yuto_K | 0:8c7f841516ab | 9 | |
Yuto_K | 0:8c7f841516ab | 10 | uint8_t PutMove(int8_t board[8][8]){ |
Yuto_K | 0:8c7f841516ab | 11 | return 0; |
Yuto_K | 0:8c7f841516ab | 12 | } |
Yuto_K | 0:8c7f841516ab | 13 | };*/ |
Yuto_K | 0:8c7f841516ab | 14 | |
Yuto_K | 0:8c7f841516ab | 15 | class RandomAI{ |
Yuto_K | 0:8c7f841516ab | 16 | public: |
Yuto_K | 0:8c7f841516ab | 17 | int8_t color; |
Yuto_K | 0:8c7f841516ab | 18 | RandomAI(int8_t _color){ |
Yuto_K | 0:8c7f841516ab | 19 | this->color=_color; |
Yuto_K | 0:8c7f841516ab | 20 | } |
Yuto_K | 0:8c7f841516ab | 21 | uint8_t PutMove(Board board){ |
Yuto_K | 0:8c7f841516ab | 22 | std::vector<uint8_t> coords(GetPutCoords(board,this->color)); |
Yuto_K | 0:8c7f841516ab | 23 | uint8_t idx=rand()%coords.size(); |
Yuto_K | 0:8c7f841516ab | 24 | return coords[idx]; |
Yuto_K | 0:8c7f841516ab | 25 | } |
Yuto_K | 0:8c7f841516ab | 26 | }; |