RosettaCodeData/Task/Repeat/Quackery/repeat.quackery

34 lines
970 B
Plaintext

[ stack ] is times.start ( --> s )
protect times.start
[ stack ] is times.count ( --> s )
protect times.count
[ stack ] is times.action ( --> s )
protect times.action
[ ]'[ times.action put
dup times.start put
[ 1 - dup -1 > while
times.count put
times.action share do
times.count take again ]
drop
times.action release
times.start release ] is times ( n --> )
[ times.count share ] is i ( --> n )
[ times.start share i 1+ - ] is i^ ( --> n )
[ 0 times.count replace ] is conclude ( --> )
[ times.start share
times.count replace ] is refresh ( --> )
[ times.count take 1+
swap - times.count put ] is step ( --> s )
[ nested ' times nested
swap join do ] is rosetta-times ( n x --> )