1 #include "RandomEnemy.h"
6 void RandomEnemy::move(Board
*board
, int& fromX
, int& fromY
, int& toX
, int& toY
)
10 Board::MoveList moveList
;
11 _board
->all_moves(_player
, moveList
);
13 int choice
= rand() % moveList
.size();
16 printf("choice: %i\n", choice);
18 printf("%i: (%i, %i) -> (%i, %i)\n", i, INDEX_X(moveList[i].first), INDEX_Y(moveList[i].first)
19 , INDEX_X(moveList[i].second), INDEX_Y(moveList[i].second));
23 fromX
= INDEX_X(moveList
[choice
].first
);
24 fromY
= INDEX_Y(moveList
[choice
].first
);
25 toX
= INDEX_X(moveList
[choice
].second
);
26 toY
= INDEX_Y(moveList
[choice
].second
);