Below you can find some more examples of Turing machines described using Varphi.
The machine accepts an input tape containing two contiguous blocks of tallies separated by a blank tape cell, representing the moves of the two players. The first block of tallies (i.e., to the left) will represent the move of the first player, and the second block will represent the move of the second player.
Each contiguous block for a player's move can look like the following:
1
, if the move is Rock
11
, if the move is Paper
111
, if the move is Scissors
For example, the input tape 110111
would represent that the first player played Paper, and the second player played Scissors.
The output tape will be a contiguous block of tallies representing the result of the game. This output tape will take on one of the following forms:
1
, if the result was a tie
11
, if the first player won
111
, if the second player won
Below is a program accepting a single contiguous block of tallies (containing at least one tally) and duplicates it. The output tape will be a contiguous block of tallies containing double the tallies in the original contiguous block of tallies on the input tape.
Below is a Varphi program that adds (i.e., "merges") two contiguous blocks of tallies (containing at least one tally each) separated by a blank tape cell into one contiguous block of tallies.
Below is a program that adds one tally to an input tape (which, by the Rule, must contain at least one tally)
Below is a program which determines the winner of a game of between two players.
Addition By One
Add Two Numbers
Multiplication By Two
Rock, Paper, Scissors
Coin Flip
Below is an example of a nondeterministic Varphi program that, when given an input tape containing exactly one tally, returns an output tape containing one or two tallies.