From cc8486bd3e6d8561507930c75b7fdaadaadd1e85 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 26 Feb 2023 15:25:04 +0100 Subject: Added IO samples --- samples/io/echo.bruijn | 4 ++++ samples/io/reverse.bruijn | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 samples/io/echo.bruijn create mode 100644 samples/io/reverse.bruijn (limited to 'samples/io') 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] -- cgit v1.2.3