Talk:Stair-climbing puzzle: Difference between revisions
Content added Content deleted
m (moved Talk:Stair Climbing to Talk:Stair-climbing puzzle) |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 2: | Line 2: | ||
The problem is ambiguous as stated. It says to climb one step up, not climb up one step up from the starting position. Thus the original C# code that was there solved the 'climb one step up'. <span style="font-size: smaller;" class="autosigned">—Preceding unsigned comment added by [[Special:Contributions/71.59.209.100|71.59.209.100]]</span> |
The problem is ambiguous as stated. It says to climb one step up, not climb up one step up from the starting position. Thus the original C# code that was there solved the 'climb one step up'. <span style="font-size: smaller;" class="autosigned">—Preceding unsigned comment added by [[Special:Contributions/71.59.209.100|71.59.209.100]]</span> |
||
:Okay, I've made it more explicit. —[[User:Underscore|Underscore]] 00:30, 7 November 2009 (UTC) |
:Okay, I've made it more explicit. —[[User:Underscore|Underscore]] 00:30, 7 November 2009 (UTC) |
||
Am I wrong or recursion can be simply avoided since the "action" is done indeed into step? So the following C code |
|||
<lang c> |
|||
void step_up() |
|||
{ |
|||
while ( !step() ) ; |
|||
} |
|||
</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) |
Latest revision as of 14:59, 6 February 2010
Problem statement
The problem is ambiguous as stated. It says to climb one step up, not climb up one step up from the starting position. Thus the original C# code that was there solved the 'climb one step up'. —Preceding unsigned comment added by 71.59.209.100
- Okay, I've made it more explicit. —Underscore 00:30, 7 November 2009 (UTC)