fazendo tabelas de resultados das execuções do algoritmo genético no relatório
[xYpjg3TdSw.git] / RandomEnemy.cpp
blobd5dce46905532d3404ce8654b03d56cf5c51ad67
1 #include "RandomEnemy.h"
2 #include "Board.h"
4 #include <cstdio>
6 void RandomEnemy::move(Board *board, int& fromX, int& fromY, int& toX, int& toY)
8 _board = board;
10 Board::MoveListOt moveList;
11 int choice = rand() % _board->all_moves(_player, moveList);
14 printf("choice: %i\n", choice);
15 reps(i, moveList) {
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));
18 fflush(stdout);
19 } //*/
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]));