Minimax algorithm: https://en.wikipedia.org/wiki/Minimax (I actually generally use negamax, the non-corecursive version, but you should understand minimax first)
"Tying the knot" in Haskell
That is, it's possible to create circular lists in Haskell like so:
let x = 1:y -- x = 1 cons y
y = 0:x -- y = 0 cons x
in x -- return x
Which will return an infinite list of alternating 1's and 0's which only take up 2 ints (and pointers) worth of memory. Calling the millionth index merely runs in circles around the list until it's followed a million pointers.EDIT: Minimax is mutual recursion, not corecursion, whoops.