Skip to content
Snippets Groups Projects
Forked from Bariatti Francesco / pingouins
21 commits ahead of the upstream repository.
go_left_up_heuristic.cpp 692 B
#include "go_left_up_heuristic.hpp"
using namespace std;

namespace mcts
{
  

  float go_left_up_heuristic::get_value(const game::penguin& game, uint8_t move) const
  {
		std::shared_ptr<game::penguin> played = game::copy(game);
		played->play(move);
		game::penguin_state state = played->get_state();
		uint32_t* penguins = state.peng_blue;
		if(!state.current_player_red) {
			penguins = state.peng_red;
		}
		uint32_t sPos = 0;
		for(int i=0; i< 4; i++) {
			sPos+=PENGUIN_POS(penguins[i]);
		}
		double res = (double) (-(-118.0 + sPos) / 118.0);
		return res;
    
  }

  int go_left_up_heuristic::get_count(const game::penguin& game, uint8_t move) const
  {
    return 100000000;
  }
}