Code: Select all
see next post
Code: Select all
see next post
Code: Select all
wstreak.l
wmaxstreak.l = 0
lstreak.l
lmaxstreak.l = 0
coinflip.l
correct.l = 0
wrong.l = 0
standings.d = 0
For i = 1 To 32
coinflip = Random(1)
If coinflip
wstreak+1
correct+1
lstreak = 0
Else
wstreak = 0
wrong+1
lstreak+1
EndIf
If wstreak > wmaxstreak
wmaxstreak = wstreak
EndIf
If lstreak > lmaxstreak
lmaxstreak = lstreak
EndIf
Next
standings = correct/(correct+wrong)
Debug "Wins: "+Str(correct)
Debug "Losses: "+Str(wrong)
Debug "Longest Winning Streak: "+Str(wmaxstreak)
Debug "Longest Losing Streak: "+Str(lmaxstreak)
Debug "Percentage: "+Str(standings*100)