Dice game probabilities: Difference between revisions

m
→‎tbd: fixed for classic Rexx
(→‎{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details)
m (→‎tbd: fixed for classic Rexx)
Line 1,257:
tbd</pre>
===tbd===
<lang rexx>oid='diet.xxx'; Call sysFileDelete'erase' oid
{{incorrect|REXX| <br> This version isn't Classic REXX, it uses non-ASCII constructs. <br> Please use Classic REXX syntax. <br>}}
<lang rexx>oid='diet.xxx'; Call sysFileDelete oid
Call test '9 4 6 6'
Call test '5 10 6 7'
Line 1,270 ⟶ 1,268:
cnt2.=0
win.=0
nn=10000010000
Call time 'R'
Do i=1 To nn
sum1=sum(n1 s1) ; cnt1.sum1+=cnt1.sum1+1
sum2=sum(n2 s2) ; cnt2.sum2+=cnt2.sum2+1
Select
When sum1>sum2 Then win.1+=win.1+1
When sum1<sum2 Then win.2+=win.2+1
Otherwise win.0+=win.0+1
End
End
Line 1,290 ⟶ 1,288:
*/
Call o time('E') 'seconds elapsed'
Return
 
sum: Parse Arg n s
sum=0
Do k=1 To n
sum+=sum+rand(s)
End
Return sum
2,299

edits