Created
August 23, 2012 20:39
-
-
Save benhowes/3441417 to your computer and use it in GitHub Desktop.
Simple array style
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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