1 #include "RandomEnemy.h"
6 void RandomEnemy::move(Board
*board
, int& fromX
, int& fromY
, int& toX
, int& toY
)
10 Board::MoveListOt moveList
;
11 int choice
= rand() % _board
->all_moves(_player
, moveList
);
14 printf("choice: %i\n", choice);
16 printf("%i: (%i, %i) -> (%i, %i)\n", i, INDEX_X(moveList[i].first), INDEX_Y(moveList[i].first)
17 , INDEX_X(moveList[i].second), INDEX_Y(moveList[i].second));
21 fromX
= INDEX_X(INDEX_FROM(moveList
[choice
]));
22 fromY
= INDEX_Y(INDEX_FROM(moveList
[choice
]));
23 toX
= INDEX_X(INDEX_TO(moveList
[choice
]));
24 toY
= INDEX_Y(INDEX_TO(moveList
[choice
]));