aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMarvin Borner2023-02-26 15:25:04 +0100
committerMarvin Borner2023-02-26 15:25:04 +0100
commitcc8486bd3e6d8561507930c75b7fdaadaadd1e85 (patch)
tree6c5267db7cb1ad608d1fee984031746c1b50eb9d
parent2d4c48368bd6d2ccca7302e5eb0b0ba3f3cd6581 (diff)
Added IO samples
-rw-r--r--samples/io/echo.bruijn4
-rw-r--r--samples/io/reverse.bruijn7
2 files changed, 11 insertions, 0 deletions
diff --git a/samples/io/echo.bruijn b/samples/io/echo.bruijn
new file mode 100644
index 0000000..192bab1
--- /dev/null
+++ b/samples/io/echo.bruijn
@@ -0,0 +1,4 @@
+# "echo text | bruijn echo.bruijn"
+
+# returning the binary encoded argument ⇒ echo
+main [0]
diff --git a/samples/io/reverse.bruijn b/samples/io/reverse.bruijn
new file mode 100644
index 0000000..7a3553f
--- /dev/null
+++ b/samples/io/reverse.bruijn
@@ -0,0 +1,7 @@
+# "echo tacocat | bruijn reverse.bruijn"
+
+:import std/List .
+
+# stdin is encoded as binary numbers in a list
+# reversing the list reverses the input!
+main [<~>0]