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

@ -1,6 +1,6 @@
MIT License
Copyright (c) <year> <copyright holders>
Copyright (c) 2022 0x4261756D
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

View File

@ -1,3 +1,9 @@
# kurz
Queue based language
Queue based language
## Roadmap
- [x] turing completeness
- [ ] compiled
- [ ] cross-plattform
- [ ] self-hosted

View File

@ -180,7 +180,6 @@ fn main()
{
Ok(maybe_msg) =>
{
println!("---Successfully parsed '{}'---", args[2]);
if let Some(msg) = maybe_msg
{
print!("---Output---\n\n{}", msg);

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