Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Internet Gambling > Software
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-02-2007, 07:21 PM
saijista saijista is offline
Junior Member
 
Join Date: Dec 2006
Posts: 4
Default Keith Rule\'s C# evaluator for multi-way matchups?

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!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:46 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.