diff options
author | Mathias Magnusson <mathias@magnusson.space> | 2025-08-04 23:12:39 +0200 |
---|---|---|
committer | Mathias Magnusson <mathias@magnusson.space> | 2025-08-04 23:12:39 +0200 |
commit | 392f0c4be0d4c034a4b161337f8f3c5fbf46358a (patch) | |
tree | 493cef6315b016e8ec7f9be051be7bb904e16add /tests/recurse.hgn | |
parent | 22f24043755ed320eff8a121aa1b80ede3b3a37f (diff) | |
download | huginn-main.tar.gz |
Diffstat (limited to 'tests/recurse.hgn')
-rw-r--r-- | tests/recurse.hgn | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/recurse.hgn b/tests/recurse.hgn new file mode 100644 index 0000000..bf9a0fd --- /dev/null +++ b/tests/recurse.hgn @@ -0,0 +1,11 @@ +main := proc() { + print_up_to(read_int(0)) + exit(0) +} + +print_up_to := proc(n) { + print(n) + if n > 0 { + print_up_to(n - 1) + } +} |