Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Rep-string/Quackery/rep-string.quackery
Normal file
24
Task/Rep-string/Quackery/rep-string.quackery
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
[ false swap
|
||||
dup size 1 > if
|
||||
[ [] temp put
|
||||
dup size factors
|
||||
-1 split drop
|
||||
witheach
|
||||
[ 2dup split drop
|
||||
dip [ over size swap / ]
|
||||
dup temp replace
|
||||
swap of over = if
|
||||
[ drop not
|
||||
temp share
|
||||
conclude ] ]
|
||||
temp release ] swap ] is rep$ ( $ --> $ b )
|
||||
|
||||
[ dup rep$ iff
|
||||
[ say 'The shortest rep-string in "'
|
||||
swap echo$
|
||||
say '" is "' echo$
|
||||
say '".' ]
|
||||
else
|
||||
[ say 'There is no rep-string for "'
|
||||
nip echo$ say '".' ]
|
||||
cr ] is task ( $ --> )
|
||||
Loading…
Add table
Add a link
Reference in a new issue