<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Poker Simulation in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/364556#M64680</link>
    <description>&lt;P&gt;Calling&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check RANDPERK() in IML .&lt;/P&gt;
&lt;P&gt;Check Rick's blog. there are many blogs about it .&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jun 2017 12:57:17 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2017-06-06T12:57:17Z</dc:date>
    <item>
      <title>Poker Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/364323#M64672</link>
      <description>&lt;P&gt;Im new to SAS and I am trying to do something fairly simple.&amp;nbsp; I want to create a deck of playing cards and shuffle that deck.&amp;nbsp; Then I want to produce 5 card poker hands and find the probabilities of producing certain hands (eg flush, straight flush, etc.)&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 17:49:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/364323#M64672</guid>
      <dc:creator>kbry1180</dc:creator>
      <dc:date>2017-06-05T17:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Poker Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/364324#M64673</link>
      <description>&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/Generate-Poker-Hands-in-SAS/m-p/145066/highlight/true#M38543" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/Generate-Poker-Hands-in-SAS/m-p/145066/highlight/true#M38543&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2014/02/03/sample-without-replacement.html" target="_blank"&gt;http://blogs.sas.com/content/iml/2014/02/03/sample-without-replacement.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 17:52:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/364324#M64673</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-05T17:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Poker Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/364342#M64674</link>
      <description>&lt;P&gt;With or without draw?&lt;/P&gt;
&lt;P&gt;Or Texas Hold-em?&lt;/P&gt;
&lt;P&gt;Or other version, Dr Pepper perhaps?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 19:22:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/364342#M64674</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-05T19:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Poker Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/364462#M64676</link>
      <description>&lt;P&gt;have you given any thought to what kind of poker is played or do you just want to draw 5 cards eg from a deck and see what hand you have?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 05:37:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/364462#M64676</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-06-06T05:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Poker Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/364474#M64677</link>
      <description>I am considering doing probabilities across different games. Perhaps run simulations using 5 card stud rules, 5 card (single draw), and seven card stud.&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Jun 2017 06:22:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/364474#M64677</guid>
      <dc:creator>kbry1180</dc:creator>
      <dc:date>2017-06-06T06:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Poker Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/364556#M64680</link>
      <description>&lt;P&gt;Calling&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check RANDPERK() in IML .&lt;/P&gt;
&lt;P&gt;Check Rick's blog. there are many blogs about it .&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 12:57:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/364556#M64680</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-06-06T12:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Poker Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/364578#M64684</link>
      <description>&lt;P&gt;Other references include&lt;/P&gt;
&lt;P&gt;Simulate Blackjack: &lt;A href="https://communities.sas.com/t5/SAS-IML-File-Exchange/Simulating-a-Blackjack-Game/ta-p/289668" target="_blank"&gt;https://communities.sas.com/t5/SAS-IML-File-Exchange/Simulating-a-Blackjack-Game/ta-p/289668&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;Value of Poker Hands:&lt;A href="https://communities.sas.com/t5/SAS-Procedures/Allocating-Values-to-Poker-Hands/m-p/146459#M38870" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/Allocating-Values-to-Poker-Hands/m-p/146459#M38870&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My personal view: This project is not particularly simple. If you are just looking for a project to get started in&amp;nbsp;SAS, there are simpler simulations. For example, craps and blackjack have simpler rules. You can simulate craps in about 20-30 lines of SAS code. For a first project, you might even try to simulate a game related to flipping coins. Good luck!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 13:37:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/364578#M64684</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-06-06T13:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Poker Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/364711#M64689</link>
      <description>&lt;P&gt;In our class, we created a deck and shuffled cards. &amp;nbsp;Then we did a very simplified poker game where we dealt five cards and kept track of only matching cards(e.g. pair, 3 of a kind and 4 of a kind). &amp;nbsp;I understand programming rules for the higher ranked hands (e.g. straight, flush, etc.) is a little trickier. &amp;nbsp;With that being said, I may forgo using five card draw rules so I can spend more time on creating code for the higher hands. &amp;nbsp;Then just do a simple 5 card and 7 card stud simulation i.e. no draws. &amp;nbsp;&lt;/P&gt;&lt;P&gt;I also considered doing a blackjack simulation but thought maybe some of the rules would be more complicated than a poker simulation. &amp;nbsp;I could be wrong. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 19:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/364711#M64689</guid>
      <dc:creator>kbry1180</dc:creator>
      <dc:date>2017-06-06T19:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Poker Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/365172#M64734</link>
      <description>&lt;P&gt;Here is the code we used to create a standard 52 card deck.&amp;nbsp; We shuffled using proc sort and dealt a five card hand using proc surveryselect.&amp;nbsp; Finally, we used proc freq to keep track of "kind", i.e. one of a kind, two of a kind (pair), and three of a kind (trips).&amp;nbsp; Does anyone have suggestions on how to program SAS to find the frequency of the higher ranked hands (straights, flushes, royal flush, etc.)?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let seed=1210; 
%let decksize=52;
%let handsize=5;
%let nsims=10;
%let nhands=1;

data _null_;
ncards=&amp;amp;handsize*&amp;amp;nhands;
call symput("ncards", ncards);
run;

data deck;
call streaminit(&amp;amp;seed);
do suit="C","D","H","S";
do value="2","3","4","5","6","7","8","9","T","J","Q","K","A";
order=rand("uniform");
output;
end;
end;
run;

proc sort data=deck;
by order;

/*proc print data=deck;
run;*/ 

proc surveyselect data=deck
method=srs
seed=&amp;amp;seed
sampsize=&amp;amp;ncards
rep=&amp;amp;nsims
out=cards;
run;

/*proc print data=cards;
run; */

/*data hands;
set cards;
hand=ceil(_n_/&amp;amp;handsize);
run;*/

/*proc print data=hands;
run;*/


proc freq data=cards;
tables value/out=freqval;
by replicate;
run;

/*proc print data=freqval;
run;*/

proc means data=freqval;
var count;
by replicate;
output out=maxnum max=kind;
run;

proc freq data=maxnum;
tables kind;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Jun 2017 20:27:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/365172#M64734</guid>
      <dc:creator>kbry1180</dc:creator>
      <dc:date>2017-06-07T20:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Poker Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/365195#M64735</link>
      <description>More specifically, does anyone have suggestions on how to program SAS to recognize straights using the code listed?</description>
      <pubDate>Wed, 07 Jun 2017 23:51:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/365195#M64735</guid>
      <dc:creator>kbry1180</dc:creator>
      <dc:date>2017-06-07T23:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: Poker Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/438764#M69107</link>
      <description>&lt;P&gt;Rick_SAS,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am interested to view the blackjack reference you provided however I am unable to view as it states access denied--&lt;SPAN&gt;You do not have sufficient privileges for this resource or its parent to perform this action. Could you please DM or share another way. Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 19:39:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/438764#M69107</guid>
      <dc:creator>jltroup10</dc:creator>
      <dc:date>2018-02-20T19:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Poker Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/438776#M69109</link>
      <description>&lt;P&gt;Both of Rick's link work fine for me. Are both not working?&lt;/P&gt;
&lt;P&gt;You may need to try a different computer.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 20:15:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/438776#M69109</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-20T20:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Poker Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/438787#M69110</link>
      <description>&lt;P&gt;The first link (blackjack) doesn't work. The second link works fine for me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 20:36:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/438787#M69110</guid>
      <dc:creator>jltroup10</dc:creator>
      <dc:date>2018-02-20T20:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Poker Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/438791#M69111</link>
      <description>&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-IML-File-Exchange/Simulating-a-Blackjack-Game/ta-p/289668" target="_blank"&gt;https://communities.sas.com/t5/SAS-IML-File-Exchange/Simulating-a-Blackjack-Game/ta-p/289668&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-IML-File-Exchange/Simulating-a-Blackjack-Game/ta-p/289668" target="_self"&gt;Link&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 20:39:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/438791#M69111</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-20T20:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Poker Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/438848#M69113</link>
      <description>&lt;P&gt;Recognizing straights:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp; Instead of do val="2","3",..... "K","A", why not make all the values into numbers, as in&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do val=2 to 14&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;If you want to see the letters J, Q, K, and A then just apply a format to val.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Let's say you have your hand recorded in 5 variables: card1 through card5, and define &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; array crd{5} card1-card5&lt;BR /&gt;Then for a straight I believe it is sufficient if
&lt;OL&gt;
&lt;LI&gt;range(of crd{*})=4&lt;BR /&gt;&amp;nbsp; and&lt;/LI&gt;
&lt;LI&gt;var(of crd{*})=2.5&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 02:11:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Poker-Simulation/m-p/438848#M69113</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-02-21T02:11:06Z</dc:date>
    </item>
  </channel>
</rss>

