Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
36
Task/Josephus-problem/Quackery/josephus-problem.quackery
Normal file
36
Task/Josephus-problem/Quackery/josephus-problem.quackery
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
[ stack ] is survivors ( --> s )
|
||||
|
||||
[ stack ] is prisoners ( --> s )
|
||||
|
||||
[ stack ] is executioner-actions ( --> s )
|
||||
|
||||
[ [] swap times [ i^ join ]
|
||||
prisoners put ] is make-prisoners ( n --> )
|
||||
|
||||
[ prisoners take
|
||||
behead join
|
||||
prisoners put ] is walk ( --> )
|
||||
|
||||
[ prisoners take
|
||||
behead drop
|
||||
prisoners put ] is kill ( --> )
|
||||
|
||||
[ [] swap 1 - times
|
||||
[ ' walk nested join ]
|
||||
' kill nested join
|
||||
executioner-actions put ] is make-executioner ( n --> )
|
||||
|
||||
[ executioner-actions take
|
||||
behead dup do nested join
|
||||
executioner-actions put ] is execute-kth ( --> )
|
||||
|
||||
[ survivors put
|
||||
make-executioner
|
||||
make-prisoners
|
||||
[ execute-kth
|
||||
prisoners share
|
||||
size
|
||||
survivors share = until ]
|
||||
survivors release
|
||||
executioner-actions release
|
||||
prisoners take ] is josephus ( n n n --> n )
|
||||
Loading…
Add table
Add a link
Reference in a new issue