["", 0] # default stack ["", 0, ""] # ' # read input from command line ["", 0, "", 2] # 2 # push 2 to the stack ["", 0, "", 2, "3"] # "3" # push "3" to the stack ["", 0, "", 2, "3", "1"] # "1" # push "1" to the stack ["", 0, "", 2, "3", "1", 1] # 1 # push 1 to the stack [0, "", 2, "3", "1", 1, ""] # < # rotate the stack leftwards ["", 2, "3", "1", 1, "", 0] # < # rotate the stack leftwards ["", 2, "3", "1", 1, "", 0, 1] # 1 # push 1 to the stack [1, "", 2, "3", "1", 1, "", 0] # > # rotate the stack rightward [1, "", 2, "3", "1", 1, 0, ""] # ; # swap the top two stack elements [1, "", 2, "3", "1", 1, "", 0] # ; # swap the top two stack elements [1, "", 2, "3", "1", 1, "", 0, ""] # ' # read input from command line [1, "", 2, "3", "1", 1, "", 0, "", 2] # 2 "2" # push 2 to the stack [1, "", 2, "3", "1", 1, "", 0, "", 2, "3"] # "3" 3 # push "3" to the stack [1, "", 2, "3", "1", 1, "", 0, "", "3", 2] # ; # swap the top two stack elements
[] # default stack ['2] # '2 # push the character code of "2" to the stack ['2, "3"] # "3" # push "3" to the stack ['2, "3", "1"] # "1" # push "1" to the stack ['2, "3", "1", 1] # 1 # push 1 to the stack ['2, "3", "1"] # < # leave the greater of the top two stack elements on the stack ['2, 0] # < # leave the greater of the top two stack elements on the stack ['2, 0, 1] # 1 # push 1 to the stack ['2, 1] # > # leave the lesser of the top two stack elements on the stack ['2] # ; # pop the top stack value [] # ; # pop the top stack value ['2] # '2 "2" # push the character code of "2" to the stack ['2, "3"] # "3" 3 # push "3" to the stack ['2] # ; # pop the top stack item