#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::map stats = std::map(); Game game(2); std::cout << "This statistics shows the score occurence of every player, not only winners." << std::endl; std::cout << "HighCard is around 17%. It means that 1/5 cards dealt is worthless because highcard is arround 2% win rate." << std::endl; std::cout << "Winning statistics are in score_stats." << std::endl; std::ofstream myfile; myfile.open ("score_stats_occurences.txt"); for(int i = 0; i < times; i++){ game.play(); for(auto & player : game.players){ 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 / game.players.size() * 100 << "%" << std::endl; myfile << kv.first << " " << kv.second / times / game.players.size() * 100 << "%" << std::endl; } myfile.close(); return 0; }