#include "../deck.hpp" #include "../simulate.hpp" #include "../game.hpp" #include #include #include #include //32.4272 //32.4241 //32.4287 //HA,DA 73.7738 //DA,HA 72.5726 int main() { int times = 100000; std::cout << "Statistics on how big the chance is you'll end up winning with certain score" << std::endl; std::cout << "Lower percentage is better to bet on. High percentage is chance you'll win with this score" << std::endl << std::endl; std::map stats = std::map(); Game game(2); std::ofstream myfile; myfile.open ("score_stats.txt"); for(int i = 0; i < times; i++){ game.play(); auto player = game.bestPlayer; if(stats.find(player.score.name)==stats.end()){ stats[player.score.name] = 0; } stats[player.score.name]++; } for(auto &kv : stats){ std::cout<< kv.first << " " << kv.second / times * 100 << "% in the showdown" << std::endl; myfile << kv.first << " " << kv.second / times * 100 << "% in the showdown" << std::endl; } std::cout << std::endl; stats.clear(); game = Game(2); for(int i = 0; i < times; i++){ game.playTheFlop(); auto player = game.bestPlayer; if(stats.find(player.score.name)==stats.end()){ stats[player.score.name] = 0; } stats[player.score.name]++; } for(auto &kv : stats){ std::cout<< kv.first << " " << kv.second / times * 100 << "% in the flop" << std::endl; myfile << kv.first << " " << kv.second / times * 100 << "% in the flop" << std::endl; } myfile.close(); return 0; }