function plan(n) { if n > 0 { plan(n-1) // plan ahead for turn now + n } else { // do stuff for this turn } }