Skip to content

Instantly share code, notes, and snippets.

@aaronryank
Created September 5, 2017 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronryank/e8cbd233fa5e411ad6a1c1920cae36a9 to your computer and use it in GitHub Desktop.
Save aaronryank/e8cbd233fa5e411ad6a1c1920cae36a9 to your computer and use it in GitHub Desktop.
simplestack program
ZYXWVUTSRQPONMLKJIHGFEDCBA"^(-(@32-);%-^)
ZYXWVUTSRQPONMLKJIHGFEDCBA push ASCII codes for the backwards alphabet
" turn stack into string
^ push string length
( open do-while loop (do ... while top of stack truthy)
- decrement string length
( do while top of stack truthy
@32 print a space
- decrement string length
) end do-while loop
; pop string length (0)
% print string
- knock one character off the front of the string
^ push string length
) loop if string length > 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment