90 lines
1.1 KiB
Plaintext
90 lines
1.1 KiB
Plaintext
//valid,:END:
|
|
function bool bool bool => bool rule110
|
|
{
|
|
if
|
|
{
|
|
if
|
|
{
|
|
if
|
|
{
|
|
false
|
|
}
|
|
else
|
|
{
|
|
true
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if
|
|
{
|
|
deq true
|
|
}
|
|
}
|
|
}
|
|
|
|
function int => bool intToBool
|
|
{
|
|
0 !=
|
|
}
|
|
|
|
function bool => int boolToInt
|
|
{
|
|
if
|
|
{
|
|
1
|
|
}
|
|
else
|
|
{
|
|
0
|
|
}
|
|
}
|
|
|
|
true 10
|
|
|
|
true 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
|
|
while
|
|
{
|
|
check
|
|
while
|
|
{
|
|
// 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
checkAndApply
|
|
// 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 true 31 0 0 0
|
|
shift-5
|
|
}
|
|
}
|
|
|
|
function any any any any any any any any any any any any any any any any any any any any any any any any any any any => any any any any any any any any any any any any any any any any any any any any any any any any any any any shift-5
|
|
{ }
|
|
|
|
function int int int int => bool int int int int checkAndApply
|
|
{
|
|
check apply
|
|
}
|
|
|
|
function int => bool int
|
|
{
|
|
0 dup 1 > req -
|
|
}
|
|
|
|
function int int int => int int int apply
|
|
{
|
|
// a b c
|
|
intToBool
|
|
// b c d
|
|
dup intToBool
|
|
// c d b e
|
|
dup intToBool
|
|
// d b e c f
|
|
req swp swp
|
|
// d e b f c
|
|
req req swp
|
|
// c d e f b
|
|
req rule110
|
|
// b c g
|
|
req req boolToInt
|
|
}
|