Stair-climbing puzzle: Difference between revisions

Removed first function which used a variable. Replaced second one with the one liner.
(solved for Rust)
(Removed first function which used a variable. Replaced second one with the one liner.)
Line 816:
 
=={{header|Nim}}==
One liner (yes it is possible in Nim).
<lang nim>proc stepUp1 =
<lang nim>proc stepUp = (while not step(): stepUp())</lang>
var deficit = 1
while deficit > 0:
if step():
dec deficit
else:
inc deficit
 
proc stepUp2 =
while not step():
stepUp2()</lang>
 
=={{header|OCaml}}==
Anonymous user