Poker-AI.org Poker AI and Botting Discussion Forum 2013-11-14T20:00:51+00:00 http://poker-ai.org/phpbb/feed.php?f=24&t=2639 2013-11-14T20:00:51+00:00 2013-11-14T20:00:51+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2639&p=5247#p5247 <![CDATA[Re: Preflop Indexing]]> spears wrote:

Long time no see. Welcome back.

Thanks!

Juk :)

Statistics: Posted by jukofyork — Thu Nov 14, 2013 8:00 pm


]]>
2013-11-14T17:09:07+00:00 2013-11-14T17:09:07+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2639&p=5246#p5246 <![CDATA[Re: Preflop Indexing]]>
Code:
private preflopHands = ["AA", "KK", "QQ", "JJ", "TT", "AKs", "99", "AQs", "AJs", "KQs", "AKo", "88", "ATs", "KJs",
            "AQo", "KTs", "QJs", "77", "A9s", "AJo", "KQo", "QTs", "A8s", "K9s", "JTs", "A7s", "ATo", "66", "KJo",
            "Q9s", "A6s", "A5s", "QJo", "KTo", "K8s", "A4s", "J9s", "A9o", "T9s", "K7s", "A3s", "55", "Q8s", "QTo",
            "A2s", "K6s", "JTo", "J8s", "A8o", "K9o", "K5s", "T8s", "Q7s", "K4s", "44", "98s", "A7o", "Q6s", "J7s",
            "K3s", "Q9o", "K2s", "T7s", "Q5s", "A5o", "A6o", "J9o", "K8o", "97s", "87s", "33", "Q4s", "T9o", "J6s",
            "A4o", "K7o", "A3o", "Q8o", "Q3s", "Q2s", "J5s", "T6s", "22", "96s", "A2o", "76s", "86s", "J4s", "J8o",
            "K6o", "T8o", "J3s", "K5o", "J2s", "T5s", "Q7o", "75s", "98o", "T4s", "65s", "85s", "95s", "K4o", "J7o",
            "T3s", "T2s", "Q6o", "T7o", "94s", "K3o", "74s", "64s", "54s", "Q5o", "84s", "97o", "K2o", "93s", "87o",
            "Q4o", "92s", "53s", "J6o", "73s", "83s", "63s", "43s", "Q3o", "T6o", "J5o", "82s", "86o", "76o", "Q2o",
            "96o", "52s", "62s", "J4o", "42s", "72s", "T5o", "32s", "J3o", "75o", "65o", "95o", "85o", "J2o", "T4o",
            "T3o", "54o", "64o", "T2o", "94o", "84o", "74o", "93o", "53o", "92o", "63o", "73o", "43o", "83o", "82o",
            "52o", "62o", "42o", "72o", "32o"];

Statistics: Posted by corintio — Thu Nov 14, 2013 5:09 pm


]]>
2013-11-14T16:55:24+00:00 2013-11-14T16:55:24+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2639&p=5245#p5245 <![CDATA[Re: Preflop Indexing]]> jukofyork wrote:

Juk :)


Long time no see. Welcome back.

Statistics: Posted by spears — Thu Nov 14, 2013 4:55 pm


]]>
2013-11-14T16:12:25+00:00 2013-11-14T16:12:25+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2639&p=5243#p5243 <![CDATA[Re: Preflop Indexing]]> MrNice wrote:

The point is that he was using a search function (for loop) to find the patterns and deduce the index....

I was interested how to avoid the for loop....

This is why I have coded mine...

Any reason you have to map the pairs like that?

If you just map pairs to be 22=[0], 33=[14], 44=[28], and so on, then the mapping function is way simpler:
Code:
int getPreflopCardsIndex(int holecard1, int holecard2)
{
   if ((holecard1/13)==(holecard2/13))
      return (max(holecard1,holecard2)*13 + min(holecard1,holecard2));
   else
      return (min(holecard1,holecard2)*13 + max(holecard1,holecard2));
}

Juk :)

Statistics: Posted by jukofyork — Thu Nov 14, 2013 4:12 pm


]]>
2013-11-14T13:44:39+00:00 2013-11-14T13:44:39+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2639&p=5241#p5241 <![CDATA[Re: Preflop Indexing]]>
I have checked on some lut... and investigated the one of PokerJokus...

The point is that he was using a search function (for loop) to find the patterns and deduce the index....

I was interested how to avoid the for loop....

This is why I have coded mine...

Statistics: Posted by MrNice — Thu Nov 14, 2013 1:44 pm


]]>
2013-11-14T13:32:47+00:00 2013-11-14T13:32:47+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2639&p=5239#p5239 <![CDATA[Re: Preflop Indexing]]> Statistics: Posted by cantina — Thu Nov 14, 2013 1:32 pm


]]>
2013-11-14T13:30:24+00:00 2013-11-14T13:30:24+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2639&p=5237#p5237 <![CDATA[Preflop Indexing]]>
Following my Preflop indexing :

Code:
static int Preflop_NonSuited_Offset[13] = {0, 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66};
static int Preflop_Suited_Offset[12] = {0, 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55};


int getPreflopCardsIndex(int holecard1, int holecard2)
{
   
   int suit_holecard1 = (int)holecard1/13;
   int suit_holecard2 = (int)holecard2/13;
   
   int rank_holecard1 = holecard1%13;
   int rank_holecard2 = holecard2%13;
   
   if(rank_holecard1>rank_holecard2)
   {
      std::swap(rank_holecard1,rank_holecard2);
   }
   
   if(suit_holecard1 != suit_holecard2)
   {
      int index = ((rank_holecard1*13) - Preflop_NonSuited_Offset[rank_holecard1]) + (rank_holecard2 - rank_holecard1);
      return index;
   }
   else
   {
      int index = 91 + (((rank_holecard1*12) - Preflop_Suited_Offset[rank_holecard1]) + ((rank_holecard2 - rank_holecard1)-1));
      return index;
   }

   return -1;
}


Probably there is a clever way to do it... Just tell me ;)


MrNice

Statistics: Posted by MrNice — Thu Nov 14, 2013 1:30 pm


]]>