![]() |
#1
|
|||
|
|||
![]()
Is it possible to use Keith Rules C# evaluator for multi-way
match-ups? I haven't succeeded to get it working, and I don't know why. Maybe you can? The results from my modified version of Keith's example code were consistently about 1% of PokerStove's and PokerBoliden's. I tried to get multi-way functionality by modifying Keith's code in the section "Using Pocket Queries in code" from his article http://www.codeproject.com/csharp/Mo...mAnalysis1.asp . public static void three() { // A Pocket Query Returns an array of all // hands that meet the criterion. ulong player1 = Hand.ParseHand("Jc 2c"); ulong player2 = Hand.ParseHand("9d 7d"); ulong player3 = Hand.ParseHand("7h 2h"); ulong board = Hand.ParseHand(""); // Holds stats long player1Wins = 0, player2Wins = 0, player3Wins = 0, ties = 0, count = 0; // Iterate through 10000 trials. for (int trials = 0; trials < 10000; trials++) { // Pick a random board ulong boardMask = Hand.RandomHand(board, player1 | player2 | player3, 5); // Create a hand value for each player uint player1HandValue = Hand.Evaluate(boardMask | player1, 7); uint player2HandValue = Hand.Evaluate(boardMask | player2, 7); uint player3HandValue = Hand.Evaluate(boardMask | player3, 7); // Calculate Winners if (player1HandValue > player2HandValue && player1HandValue > player3HandValue) { player1Wins++; } else if (player2HandValue > player1HandValue && player2HandValue > player3HandValue) { player2Wins++; } else if (player3HandValue > player1HandValue && player3HandValue > player2HandValue) { player3Wins++; } else { ties++; } count++; } // Print results Console.WriteLine("Player1: {0:0.0}%", (player1Wins + ties / 3.0) / ((double)count) * 100.0); Console.WriteLine("Player2: {0:0.0}%", (player2Wins + ties / 3.0) / ((double)count) * 100.0); Console.WriteLine("Player3: {0:0.0}%", (player3Wins + ties / 3.0) / ((double)count) * 100.0); } Best Regards and biggest Thank yous! |
![]() |
|
|