Skip to content

Instantly share code, notes, and snippets.

@vardanagarwal
Created December 14, 2019 20:41
Show Gist options
  • Save vardanagarwal/9c8dc05b0f6fecb8728ee7c817fb3fef to your computer and use it in GitHub Desktop.
Save vardanagarwal/9c8dc05b0f6fecb8728ee7c817fb3fef to your computer and use it in GitHub Desktop.
def action(input_char, replace_with, move, new_state):
global tapehead, state
if tape[tapehead] == input_char:
tape[tapehead] = replace_with
state = new_state
if move == 'L':
tapehead -= 1
else:
tapehead += 1
return True
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment