v # # | |_ infinite-length buffer of storage cells for input string - none of those dangerous buffer overflow bugs in this language |_ storage cell for input pointer (pointing at the next cell to be inserted into the sorted list) > 020p v (initialise input ptr to 0) > 20g 4+0p 20g 1+ 20p v (store inputted char at *input_ptr++) > > ~:a-| (get input char from stdin, until newline (0xA)) ^ $ > v < > 020p v (reinitialise input ptr to 0, since it was messed up during the input process) v {0< (create a second stack - the data is moved back and forth between the two stacks to sort it) > b577**+ v (add a sentinel value (256) to new stack, since that simplifies future loops) v < >>02-09-g : 1+ 02-09-p 09-g v (fetch the next character, i.e. *input_ptr++) v < ^ < >v (if input was not a space (= end of input string), continue looping) > :84*-| (compare input to 32 (space)) v < v ,< >$ >:b577**+-| (if input was a space, print out the stack up to the sentinel and then quit) q v < > \ 01-u ^ (wrong order: swap the top values and put one onto the SOSS) > 2{# 10p:10g\10g4} wv (duplicate then compare the top two values on the TOSS) v << (at this point, the SOSS contains the list in sorted order) v < > 1u:| (keep pushing cells off of the SOSS and onto the TOSS, until one is a zero - then pop it, and go back to the top for another iteration) >$ ^