Simple Simulation of ESPN Streak for the Cash

Share your advanced PureBasic knowledge/code with the community.
michaeled314
Enthusiast
Enthusiast
Posts: 340
Joined: Tue Apr 24, 2007 11:14 pm

Simple Simulation of ESPN Streak for the Cash

Post by michaeled314 »

my dad said my standings, http://streak.espn.go.com/entryStreaks? ... egmentID=2 , were not better than a coin flip so I had to prove it to him

Code: Select all

see next post
http://streak.espn.go.com/
Last edited by michaeled314 on Fri Apr 10, 2009 5:28 pm, edited 1 time in total.
michaeled314
Enthusiast
Enthusiast
Posts: 340
Joined: Tue Apr 24, 2007 11:14 pm

Post by michaeled314 »

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)
Post Reply