summaryrefslogtreecommitdiff
path: root/test_programs/brainfuck/truth_machine.bf
diff options
context:
space:
mode:
authorMatthew Hall <hallmatthew314@gmail.com>2022-09-04 13:50:58 +1200
committerMatthew Hall <hallmatthew314@gmail.com>2022-09-04 13:50:58 +1200
commit8dfc184c00f7c04e70f861914a944e3dbee3a136 (patch)
tree3be778f98ece51ef1a769f3211fc96a41b1afc00 /test_programs/brainfuck/truth_machine.bf
parente449c3c866b0c91a0bc34d5cb462c47b5fa43ce1 (diff)
Add testing programs to repo
Diffstat (limited to 'test_programs/brainfuck/truth_machine.bf')
-rw-r--r--test_programs/brainfuck/truth_machine.bf7
1 files changed, 7 insertions, 0 deletions
diff --git a/test_programs/brainfuck/truth_machine.bf b/test_programs/brainfuck/truth_machine.bf
new file mode 100644
index 0000000..964de9f
--- /dev/null
+++ b/test_programs/brainfuck/truth_machine.bf
@@ -0,0 +1,7 @@
+my own personal attempt at making a truth machine in brainfuck
+>+++++++++++++++++++++++++++++++++++++++++++++++++ set memory cell 1 to 49 (ascii code for '1')
+<, move back to cell 0 and read the byte
+------------------------------------------------ subtract 48 to test if it was '0'
+[ if it wasn't zero
+>.< output value of cell 1 and move back (loops forever)
+]>-. otherwise subtract 1 from cell 0 and output the value (ascii code for '0')