Stair-climbing puzzle: Difference between revisions
Content added Content deleted
(→{{header|C}}: Adapted C++ version into something that will work with classic K&R too) |
m (→{{header|C}}: Bah, might as well use C89-isms) |
||
Line 58: | Line 58: | ||
=={{header|C}}== |
=={{header|C}}== |
||
<lang c>void step_up() |
<lang c>void step_up(void) |
||
{ |
{ |
||
while (!step()) { |
while (!step()) { |
||
Line 66: | Line 66: | ||
The following uses a variable and is a bit longer, but avoids a possible stack overflow: |
The following uses a variable and is a bit longer, but avoids a possible stack overflow: |
||
<lang c>void step_up() |
<lang c>void step_up(void) |
||
{ |
{ |
||
int i = 0; |
int i = 0; |