Small updates to celebrate turing-completeness

This commit is contained in:
0x4261756D
2022-12-22 00:08:13 +01:00
parent e4a7bcccc0
commit dedb601a9b
4 changed files with 26 additions and 14 deletions

View File

@ -35,9 +35,10 @@ function bool bool bool => bool rule110
}
}
arr val { bool 32 }
arr val { bool 34 }
15 true val.write
33 true val.write
printArrays
function int => bool int check
{
@ -46,7 +47,13 @@ function int => bool int check
function => fullApply
{
0 false val2.write
// 0 b c
0 1 false val.read val.read
0 rule110 val2.write
val.length 1 - 1 dup - req
val.read val.read false
rule110 val.length 1
req - req val2.write
true 1
while
{
@ -62,7 +69,7 @@ function => fullApply
dup val2.write
checkUp-1
}
1 - false val2.write
deq
}
function int => bool int checkUp
@ -79,7 +86,7 @@ function int => bool int checkUp-1
< req
}
arr val2 { bool 32 }
arr val2 { bool 34 }
function => copyArrays
{
@ -93,15 +100,15 @@ function => copyArrays
deq
}
function bool => int boolToInt
function bool => str boolToSym
{
if
{
1
"#"
}
else
{
0
"-"
}
}
@ -110,14 +117,14 @@ function => printArrays
true 0
while
{
dup val.read req boolToInt req print
dup val.read req boolToSym req print
checkUp
}
deq
"" println
}
true 10
true 33
while
{
fullApply
@ -125,4 +132,4 @@ while
printArrays
check
}
deq
deq