RosettaCodeData/Task/Weird-numbers/Quackery/weird-numbers.quackery
2023-07-01 13:44:08 -04:00

42 lines
1 KiB
Text

[ stack ] is target ( --> s )
[ stack ] is success ( --> s )
[ stack ] is makeable ( --> s )
[ bit makeable take
2dup & 0 !=
dip [ | makeable put ] ] is made ( n --> b )
[ ' [ 0 ] swap
dup target put
properdivisors
0 over witheach +
target share > not iff
[ target release
2drop false ] done
true success put
0 makeable put
witheach
[ over witheach
[ over dip
[ +
dup target share = iff
[ false success replace
drop conclude ] done
dup target share < iff
[ dup made not iff
join else drop ]
else drop ] ]
success share not if conclude
drop ]
drop
target release
makeable release
success take ] is weird ( n --> b )
[] 0
[ 1+
dup weird if
[ tuck join swap ]
over size 25 = until ]
drop
echo