RosettaCodeData/Task/Stack/Quackery/stack.quackery
2023-07-01 13:44:08 -04:00

15 lines
583 B
Text

[ size 1 = ] is isempty ( s --> b )
[ stack ] is mystack ( --> s )
mystack isempty if [ say "mystack is empty" cr cr ]
23 mystack put
mystack share echo say " is on the top of mystack" cr cr
mystack mystack put ( you can put anything on an ancillary stack, even itself! )
mystack share echo say " is on the top of mystack" cr cr
mystack take echo say " has been removed from mystack" cr cr
mystack take echo say " has been removed from mystack" cr cr
mystack isempty if [ say "mystack is empty" cr cr ]
say "you are in a maze of twisty little passages, all alike"