add example from slides
This commit is contained in:
parent
314286bf1e
commit
8bb03f9dc8
1 changed files with 17 additions and 0 deletions
17
tests/27_boom.test
Normal file
17
tests/27_boom.test
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
void countdown (int n) {
|
||||||
|
if (n != 0) {
|
||||||
|
puti(n);
|
||||||
|
puts("\n");
|
||||||
|
countdown(n - 1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
puts("BOUM!\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main () {
|
||||||
|
puts("Count from? ");
|
||||||
|
countdown(geti());
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Reference in a new issue