From 3c51927c9ac6b736822a43612308e8e35366f80a Mon Sep 17 00:00:00 2001 From: cannoli-fruit Date: Sat, 25 Jul 2026 19:28:07 -0400 Subject: [PATCH] Truth machine --- flagpole/tests/truthmachine.fp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 flagpole/tests/truthmachine.fp diff --git a/flagpole/tests/truthmachine.fp b/flagpole/tests/truthmachine.fp new file mode 100644 index 0000000..a08ecb6 --- /dev/null +++ b/flagpole/tests/truthmachine.fp @@ -0,0 +1,27 @@ +proc putchar + 0xCFFFFFFFFFFFFFFD st8 +endproc + +proc getchar + 0xCFFFFFFFFFFFFFFE ld8 +endproc + +proc puts + while dup ld8 0 == not do + dup ld8 :putchar + 1 u+ + endwhile + pop +endproc + +proc newline + 10 :putchar +endproc + +proc main + :getchar + dup :putchar + while dup "1" ld8 == do + dup :putchar + endwhile +endproc