1 #include "RandomEnemy.h"
6 void RandomEnemy::move(Board
*board
, int& fromX
, int& fromY
, int& toX
, int& toY
)
10 Board::MoveList moveList
;
13 _board
->moves(_player
, i
, j
, moveList
);
15 int choice
= rand() % moveList
.size();
18 printf("choice: %i\n", choice);
20 printf("%i: (%i, %i) -> (%i, %i)\n", i, INDEX_X(moveList[i].first), INDEX_Y(moveList[i].first)
21 , INDEX_X(moveList[i].second), INDEX_Y(moveList[i].second));
25 fromX
= INDEX_X(moveList
[choice
].first
);
26 fromY
= INDEX_Y(moveList
[choice
].first
);
27 toX
= INDEX_X(moveList
[choice
].second
);
28 toY
= INDEX_Y(moveList
[choice
].second
);