interpreter.py
def find_instruction(state,symbol):
    '''
    Given the current state and symbol (type string) at position,
    this function outputs the corresponding instruction.
    '''
    global command
    candidates,finer_candidate,error = [],None,False
    for i in command:
        if i[0] == state:
            candidates = candidates+[i]
    for i in candidates:
        if i[1] == symbol:
            if finer_candidate == None:
                finer_candidate = i
            else:
                error = True
                return 'Error, duplicated mapping state & symbol. '
    if error != True:
        return finer_candidate

    Given the current state and symbol (type string) at position,
    this function outputs the corresponding instruction.
    
Given the current state and symbol (type string) at position,
this function outputs the corresponding instruction.
Given the current state and symbol ( type string ) at position this function outputs the corresponding instruction .
def find_instruction(state,symbol):
    global command
    candidates,finer_candidate,error = [],None,False
    for i in command:
        if i[0] == state:
            candidates = candidates+[i]
    for i in candidates:
        if i[1] == symbol:
            if finer_candidate == None:
                finer_candidate = i
            else:
                error = True
                return 'Error, duplicated mapping state & symbol. '
    if error != True:
        return finer_candidate
def find_instruction ( state , symbol ) : global command candidates , finer_candidate , error = [ ] , None , False for i in command : if i [ 0 ] == state : candidates = candidates + [ i ] for i in candidates : if i [ 1 ] == symbol : if finer_candidate == None : finer_candidate = i else : error = True return 'Error, duplicated mapping state & symbol. ' if error != True : return finer_candidate
Given the current state and symbol (type string) at position,
this function outputs the corresponding instruction.
Given the current state and symbol ( type string ) at position this function outputs the corresponding instruction .
'''
    Given the current state and symbol (type string) at position,
    this function outputs the corresponding instruction.
    '''
state
symbol