Skip to content

Instantly share code, notes, and snippets.

@benhowes
Created August 23, 2012 20:39
Show Gist options
  • Save benhowes/3441417 to your computer and use it in GitHub Desktop.
Save benhowes/3441417 to your computer and use it in GitHub Desktop.
Simple array style
regress = ()->
stack = [0,1,0,1] #regress with stack of 4 and mean of 0
(result)->
stack.push(result)
stack.unshift()
sum = 0
for i in stack
sum += i
sum /= 4
if sum is 0.5 then Math.RandomInteger(0,1)
else if sum > 0.5 then 0 #based on resent history guess differently
else 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment