Exemplo n.º 1
0
GameResult Board::playRandomGame(std::default_random_engine& engine) {
  GameResult result;
  while (!isGameOver(&result)) {
    makeRandomMove(engine);
  }
  return result;
}
GameResult Board::playRandomGame()
{
	GameResult result;
	while(!isGameOver(&result))
	{
		makeRandomMove();
	}

	return result;
}
Exemplo n.º 3
0
int makeRandomMove2(HunterView h, int player)
{
	int move;
	int flag2;
	int count = 0;
	while(TRUE) {
		flag2 = FALSE;
		int r_move = makeRandomMove(h);
		int i;
		for (i=0;i<NUM_PLAYERS-1;i++) {
			if (i != player && whereIs(h,i) == r_move) {
				flag2 = TRUE;
				count++;
			}
		}
		if (flag2 == FALSE || count > 20) {
			move = r_move;
			break;
		}
	}
	return move;
}