Turing

Tape

Program

Program Trace

Challenges and Examples

Many of these were pulled from https://codingbat.com
Monkey Trouble

We have two monkeys, a and b. Position 0 of the tape will be "1" if monkey a is smiling, and "0" if not. Similarly, Position 1 of the tape will be "1" if monkey b is smiling, and "0" if not. We are in trouble if they are both smiling or if neither of them is smiling. If we are in trouble, write "T" to position 0, otherwise write "F".

Test Cases
Example Solution
start:
gotoif 0 foundleft0
gotoif 1 foundleft1
foundleft0:
right
gotoif 0 same
gotoif 1 different
foundleft1:
right
gotoif 1 same
gotoif 0 different
same:
left
write T
break
different:
left
write F
			

Language Specification

Commands

Tips