From 8bb03f9dc813b8574952165cbad7614aefb77615 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 14 Dec 2022 00:19:26 +0100 Subject: [PATCH] add example from slides --- tests/27_boom.test | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/27_boom.test diff --git a/tests/27_boom.test b/tests/27_boom.test new file mode 100644 index 0000000..10a4ef9 --- /dev/null +++ b/tests/27_boom.test @@ -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; +}