Simulate a game of Craps
Ruby 164
Pretty straightforward. Interesting features:
The crapping out cases are summarised as r%12&lt;4 and the remaining natural cases are summarised as r%4==3.
The initial string is stored in c and further rolls are taken only if this is later alphabetically than the single letter ?P (which only occurs for Point.)
f=-&gt;{rand(6)+rand(6)+2}
s=0
r=f[]
print c=r%12&lt;4?'Crapping out':r%4==3?'Natural':'Point',&quot;: #{r}
&quot;
c&gt;?P&amp;&amp;(until s==r||s==7
p s=f[]end
print s==7?&quot;Don't &quot;:&quot;&quot;,&quot;Pass&quot;)