summaryrefslogtreecommitdiff
path: root/test_programs
diff options
context:
space:
mode:
Diffstat (limited to 'test_programs')
-rw-r--r--test_programs/brainfuck/cat_eof0.bf2
-rw-r--r--test_programs/brainfuck/hello_world.bf2
-rw-r--r--test_programs/brainfuck/truth_machine.bf7
-rw-r--r--test_programs/thue/busy_beaver.thue12
-rw-r--r--test_programs/thue/hello_world.thue3
-rw-r--r--test_programs/thue/parser_test.thue8
-rw-r--r--test_programs/thue/truth_machine.thue6
7 files changed, 40 insertions, 0 deletions
diff --git a/test_programs/brainfuck/cat_eof0.bf b/test_programs/brainfuck/cat_eof0.bf
new file mode 100644
index 0000000..413fc13
--- /dev/null
+++ b/test_programs/brainfuck/cat_eof0.bf
@@ -0,0 +1,2 @@
+cat program where eof is trated as zero
+,[.,]
diff --git a/test_programs/brainfuck/hello_world.bf b/test_programs/brainfuck/hello_world.bf
new file mode 100644
index 0000000..2b52c3e
--- /dev/null
+++ b/test_programs/brainfuck/hello_world.bf
@@ -0,0 +1,2 @@
+Basic hello world program from esolangs wiki
+++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
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')
diff --git a/test_programs/thue/busy_beaver.thue b/test_programs/thue/busy_beaver.thue
new file mode 100644
index 0000000..aaec7d6
--- /dev/null
+++ b/test_programs/thue/busy_beaver.thue
@@ -0,0 +1,12 @@
+A0::=1B
+0A1::=C01
+1A1::=C11
+0B0::=A01
+1B0::=A11
+B1::=1B
+0C0::=B01
+1C0::=B11
+0C1::=H01
+1C1::=H11
+::=
+000000A000000
diff --git a/test_programs/thue/hello_world.thue b/test_programs/thue/hello_world.thue
new file mode 100644
index 0000000..de40b97
--- /dev/null
+++ b/test_programs/thue/hello_world.thue
@@ -0,0 +1,3 @@
+a::=~Hello world!
+::=
+a
diff --git a/test_programs/thue/parser_test.thue b/test_programs/thue/parser_test.thue
new file mode 100644
index 0000000..c69d6bb
--- /dev/null
+++ b/test_programs/thue/parser_test.thue
@@ -0,0 +1,8 @@
+This is a normal rule::=This is a normal cabbage
+This is an input rule::=:::
+This is an output rule::=~This text will be printed without a newline
+This is_an output rule that only prints a newline::=~
+::=
+this is normal text that shouldn't be parsed a a rule
+so is this
+and this too
diff --git a/test_programs/thue/truth_machine.thue b/test_programs/thue/truth_machine.thue
new file mode 100644
index 0000000..ec5450a
--- /dev/null
+++ b/test_programs/thue/truth_machine.thue
@@ -0,0 +1,6 @@
+*::=:::
+_::=~1
+1::=1_
+0::=~0
+::=
+*