Virtual Turing Machine
Mirror of VTM homepage
(original at http://www.nmia.com/~soki/turing/)
The Tape:
Blank character:
Initial state:
Instructions:
# This is simple script for subtraction. Its syntax (for # the tape) is the same as the addition one, but this # script assumes that the first number is greater than or # equal to the second number. pass, 1, pass, 1, R # pass the first number pass, 0, find2nd, 0, R # okay, we're past, find 2nd find2nd, 0, find2nd, 0, R # skip past zeroes find2nd, 1, delete, 0, L # found it, delete a one, go # back to delete a one from # the first number find2nd, B, goBack, B, L # no more 2nd number, need to # append a 1 on the 1st # because a number 'n' is # a string of n + 1 ones delete, 0, delete, 0, L # go back to the first number delete, 1, find2nd, 0, R # deleted a one, go to forward # to the 2nd number goBack, 0, goBack, 0, L # find the first number goBack, 1, append, 1, R # found it, need to append a 1 goBack, B, append, B, R # no more first number (it's 0) append, 0, stop, 1, R # add a 1 to the string and # stop for good
I want to:
execute this script and output:
the result of the tape only
one line per step
two lines per step
don't show the state
show the state before the tape
show the state after the tape
and don't show the form again
and show the form before the results
and show the form after the results
save this script with the values
Mirror of VTM homepage
(original at www.nmia.com/~soki/turing/)