Created
September 5, 2017 20:15
-
-
Save aaronryank/e8cbd233fa5e411ad6a1c1920cae36a9 to your computer and use it in GitHub Desktop.
simplestack program
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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