Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
41
Task/Truth-table/Quackery/truth-table.quackery
Normal file
41
Task/Truth-table/Quackery/truth-table.quackery
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
[ stack ] is args ( --> s )
|
||||
[ stack ] is results ( --> s )
|
||||
[ stack ] is function ( --> s )
|
||||
|
||||
[ args share times
|
||||
[ sp
|
||||
2 /mod iff
|
||||
[ char t ]
|
||||
else
|
||||
[ char f ]
|
||||
emit ]
|
||||
drop
|
||||
say " | " ] is echoargs ( n --> )
|
||||
|
||||
[ args share times
|
||||
[ 2 /mod swap ]
|
||||
drop ] is preparestack ( n --> b*n )
|
||||
|
||||
[ results share times
|
||||
[ sp
|
||||
iff
|
||||
[ char t ]
|
||||
else
|
||||
[ char f ]
|
||||
emit ] ] is echoresults ( b*? --> )
|
||||
|
||||
[ say "Please input your function, preceded" cr
|
||||
$ "by the number of arguments and results: " input
|
||||
trim nextword quackery args put
|
||||
trim nextword quackery results put
|
||||
trim build function put
|
||||
args share bit times
|
||||
[ cr
|
||||
i^ echoargs
|
||||
i^ preparestack
|
||||
function share do
|
||||
echoresults ]
|
||||
cr
|
||||
args release
|
||||
results release
|
||||
function release ] is truthtable ( --> )
|
||||
Loading…
Add table
Add a link
Reference in a new issue