aboutsummaryrefslogtreecommitdiff
path: root/ternary.hgn
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2025-08-04 16:55:16 +0200
committerMathias Magnusson <mathias@magnusson.space>2025-08-04 16:56:00 +0200
commit0cd88f7549afbaab837392f8fc3e5b537551d5b8 (patch)
tree151cbcb56f5e8e8077f8b5621e30925498bca5ca /ternary.hgn
parent72c7be04a6d4ad126b46a977178a0e6e8d69e308 (diff)
downloadhuginn-0cd88f7549afbaab837392f8fc3e5b537551d5b8.tar.gz
allow if expressions to evaluate to either value
Diffstat (limited to 'ternary.hgn')
-rw-r--r--ternary.hgn4
1 files changed, 4 insertions, 0 deletions
diff --git a/ternary.hgn b/ternary.hgn
new file mode 100644
index 0000000..3740fd8
--- /dev/null
+++ b/ternary.hgn
@@ -0,0 +1,4 @@
+main := proc() {
+ print(if read_int(0) 1 else 2)
+ if 1 exit(0)
+}