RosettaCodeData/Task/ABC-problem/Quackery/abc-problem-2.quackery

53 lines
1.0 KiB
Plaintext

[ ' [ 0 ] swap
witheach
[ over -1 peek
+ join ]
behead drop ] is accumulate ( [ --> [ )
[ [] swap
witheach
[ swap dip
[ over + ]
swap join ]
nip ] is add ( n [ --> [ )
[ [] unrot
[ 2dup find
2dup swap
found while
1+ split
swap size
dip rot join
unrot again ]
2drop drop
accumulate
-1 swap add ] is findall ( x [ --> [ )
[ iff [ say "True" ]
else [ say "False" ] ] is echotruth ( b --> )
[ $ "BOXKDQCPNAGTRETGQDFS"
$ "JWHUVIANOBERFSLYPCZM"
join ] constant is blocks ( --> $ )
[ -2 &
tuck pluck drop
swap pluck drop ] is remove2 ( $ n --> $ )
forward is (abc)
[ dup [] = if bail
behead upper
dip over swap findall
witheach
[ dip over
remove2
over (abc) ]
2drop ] resolves (abc) ( $ $ --> )
[ blocks swap
2 backup (abc)
bailed dup
if [ dip 2drop ]
echotruth ] is can_make_word ( $ --> )