# Add two numbers, according the the Boolos, et al., conventions. # Erase a one and move to the right (state 0). If the first square is # blank, move to the right and halt (state 1). Else, keep moving to # the right until you find a blank (state 2). Write 1 there (state # 2), move to the left until you find a blank (state 3). When you do, # move back right (state 3) and erase a 1 and move right again (state # 4). Halt. # St R W M New (0,1, ,1,r) # In state 0, if I see a 1, # write a blank and move right and goto state 1. # State 0: start state -- erase a one (1, , ,99,r) # The first number was 0, so I'm okay. (1,1,1,2,r) # State 1: (2, ,1,3,l) # Put a 1 in the first blank. (2,1,1,2,r) (3, , ,4,r) # Look for first blank (3,1,1,3,l) (4,1, ,99,r) # Erase first 1 and halt