RosettaCodeData/Task/Stair-climbing-puzzle/Python/stair-climbing-puzzle-1.py
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

9 lines
234 B
Python

def step_up1()
"Straightforward implementation: keep track of how many level we
need to ascend, and stop when this count is zero."
deficit = 1
while deficit > 0:
if step():
deficit -= 1
else:
deficit += 1