Poker-AI.org Poker AI and Botting Discussion Forum 2014-08-27T14:57:07+00:00 http://poker-ai.org/phpbb/feed.php?f=22&t=2796 2014-08-27T14:57:07+00:00 2014-08-27T14:57:07+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2796&p=6263#p6263 <![CDATA[Re: Code to create a deck]]> If I'm not mistaken, I got (stole) the idea from Spears LUT handevaluator

Statistics: Posted by Bliss — Wed Aug 27, 2014 2:57 pm


]]>
2014-08-22T18:44:36+00:00 2014-08-22T18:44:36+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2796&p=6250#p6250 <![CDATA[Code to create a deck]]>
Code:
        private List<KeyValuePair<Suits, byte>> createDeck()
        {
            List<KeyValuePair<Suits, byte>> deck = new List<KeyValuePair<Suits, byte>>();
            for (byte i = 0; i < 52; i++)
            {
                Suits suit = i % 2 == 0 ? i % 4 == 0 ? Suits.Diamond : Suits.Heart : i % 4 == 1 ? Suits.Spade : Suits.Club;
                deck.Add(new KeyValuePair<Suits, byte>(suit, (byte)(i % 13)));
            }
            return deck;
        }

        public enum Suits
        {
            Club,
            Diamond,
            Heart,
            Spade
        }

Statistics: Posted by Watts — Fri Aug 22, 2014 6:44 pm


]]>