Jump to content

Talk:Stair-climbing puzzle: Difference between revisions

→‎Problem statement: ? recursion unnecessary and wrong? ?
(→‎Problem statement: ? recursion unnecessary and wrong? ?)
Line 10:
</lang>
would work? Why is used recursion if indeed <tt>step_up</tt> does nothing more? ... --[[User:ShinTakezou|ShinTakezou]] 10:30, 7 November 2009 (UTC)
Moreover... maybe I am loosing bits however: the recursive C++ solution does not work... Let us suppose the first call to step fails, so that it returns false and the step_up is called again; now let us suppose that at this first level of recursion the step() is successful; the loop exit and control returns to the caller which repeat the loop, that re-execute the step() function... so let imagine now it is successful... this would mean we climbed two steps, not one... I set up my codes to avoid this; if someone explain me why I am wrong I will fix (if time allows:/) --[[User:ShinTakezou|ShinTakezou]] 10:39, 7 November 2009 (UTC)
Cookies help us deliver our services. By using our services, you agree to our use of cookies.