aboutsummaryrefslogtreecommitdiffhomepage
path: root/samples/rosetta/universal_lambda_machine.bruijn
diff options
context:
space:
mode:
authorMarvin Borner2024-03-25 18:59:03 +0100
committerMarvin Borner2024-03-25 18:59:48 +0100
commit14e38ce378236cf54924b58396168c1e94f8e6b2 (patch)
treeecbbb75517695de8897a2a9c58aa1a97ec2546f5 /samples/rosetta/universal_lambda_machine.bruijn
parentf8398804d351667a7b887b89f6f70c7d5c407d22 (diff)
Improved samples by adding links to problems
Diffstat (limited to 'samples/rosetta/universal_lambda_machine.bruijn')
-rw-r--r--samples/rosetta/universal_lambda_machine.bruijn39
1 files changed, 0 insertions, 39 deletions
diff --git a/samples/rosetta/universal_lambda_machine.bruijn b/samples/rosetta/universal_lambda_machine.bruijn
deleted file mode 100644
index 60ba551..0000000
--- a/samples/rosetta/universal_lambda_machine.bruijn
+++ /dev/null
@@ -1,39 +0,0 @@
-:import std/Combinator .
-:import std/Number/Binary .
-:import std/Meta M
-:import std/List .
-
-# converts string to list of bits
-str→blc map (c ∘ lsb)
-
-:test (str→blc "0010") ([[1]] : ([[1]] : ([[0]] : {}[[1]])))
-
-# converts list of bits to string
-blc→str map [0 '0' '1']
-
-:test (blc→str ([[1]] : ([[1]] : ([[0]] : {}[[1]])))) ("0010")
-
-# evaluates BLC string
-main str→blc → M.blc→meta+rest → &M.eval → blc→str
-
-# --- tests ---
-
-id "0010"
-
-# 342 bit IO example
-io "010100011010000000011000010110011110000010010111110111100001010110000000011000011111000000101111110110010111111011001011110100111010111100010000001011100101010001101000000000010110000101011111101111100000010101111011111011111100001011000000101111111010110111000000111111000010110111101110011110100000010110000011011000100000101111000111001110"
-
-# quine example
-quine "000101100100011010000000000001011011110010111100111111011111011010000101100100011010000000000001011011110010111100111111011111011010"
-
-# 100 doors example
-doors "0001000100010101000110100000010110000011001110110010100011010000000000101111111000000101111101011001011001000110100001111100110100101111101111000000001011111111110110011001111111011100000000101111110000001011111010110011011100101011000000101111011001011110011110011110110100000000001011011100111011110000000001000000111001110100000000101101110110"
-
-# sieve of Eratosthenes example
-primes "00010001100110010100011010000000010110000010010001010111110111101001000110100001110011010000000000101101110011100111111101111000000001111100110111000000101100000110110"
-
-:test (main id) (empty)
-:test (main io) ("11010")
-:test (main quine) (quine)
-:test (take (+20) (main doors)) ("10010000100000010000")
-:test (take (+20) (main primes)) ("00110101000101000101")