#!/usr/local/bin/vtml -2 -b_ -spass_first -S ##echo This script adds two numbers. The format of the tape is: ##echo ##echo _1...1_1...1_ ##echo ##echo where 1...1 is a string of 1s. The first string of 1s represents the ##echo first number in unary, i.e., the number n is represented by a string of ##echo (n + 1) 1s (e.g. 2 is represented by `111'). The second string of 1s ##echo represents the second number in unary. The `_' in the middle separates ##echo the numbers. So an initial tape of `_111_111_' will add 2 and 2, and ##echo hopefully get `_11111___' (`11111' is 4 in unary). ##echo pass_first, 1, pass_first, 1, R # get past the first number pass_first, _, pass_second, 1, R # change the middle _ pass_second, 1, pass_second, 1, R # get past the second number pass_second, _, delete1, _, L # end of second number, start going # back to delete the last 1 delete1, 1, delete2, _, L # delete the last 1, go back to # delete the second to last 1 delete2, 1, HALT, _, R # deletes the second to last 1