// 3-state busy beaver Turing Machine example
// See how many 1's we can write on a blank tape using
// only a three-state Turing Machine

states s1 s2 s3 // list of state names, first is starting state
symbols 1 // list of symbols (- is blank cell)
tape test - // initial tape contents, blank in this case
result test 1 [1] 1 1 1 1 // expected result

// specify transistions: action state symbol state' write move
// state = the current state of the FSM
// symbol = the symbol read from the current cell
// state' = state on the next cycle
// write = symbol to be written into the current cell
// move = tape movement ("l"=left, "r"=right, "-"=stay put)
    
action s1 - s2 1 r
action s1 1 s3 1 l
action s2 - s1 1 l
action s2 1 s2 1 r
action s3 - s2 1 l
action s3 1 *halt* 1 r