Blackjack strategy: Difference between revisions

m
syntax highlighting fixup automation
m (→‎{{header|Phix}}: minor tidy, duplicate {{trans|Go}} removed)
m (syntax highlighting fixup automation)
Line 42:
 
Finally, I've done 10 years of simulations as the basic statistics can vary quite a bit from year to year. However, it will be seen that % loss varies over a narrower range - between about 0.3 and 1.8% for this particular run - which seems reasonable given the casino's edge even after basic strategy is utilized.
<langsyntaxhighlight lang=go>package main
 
import (
Line 950:
simulate(50, 365)
}
}</langsyntaxhighlight>
 
{{out}}
Line 1,321:
=={{header|Nim}}==
{{trans|Go}}
<langsyntaxhighlight lang=Nim>import random, sequtils, strformat, strutils
 
type
Line 2,149:
simulate(50, 365)
 
main()</langsyntaxhighlight>
 
{{out}}
Line 2,517:
=={{header|Phix}}==
{{trans|Go}}
<!--<langsyntaxhighlight lang=Phix>-->
<span style="color: #000080;font-style:italic;">-- demo/rosetta/blackjack.exw</span>
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
Line 3,448:
<span style="color: #0000FF;">?</span><span style="color: #008000;">"done"</span>
<span style="color: #0000FF;">{}</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">wait_key</span><span style="color: #0000FF;">()</span>
<!--</langsyntaxhighlight>-->
{{out}}
<pre>
Line 3,829:
 
So interpreted languages such as Wren are probably stuck with slow times for this task.
<langsyntaxhighlight lang=ecmascript>import "random" for Random
import "./array" for Array, ArrayType
import "./dynamic" for Struct
Line 4,753:
}
 
Blackjack.main()</langsyntaxhighlight>
 
{{out}}
10,333

edits