Created
December 14, 2019 20:41
-
-
Save vardanagarwal/9c8dc05b0f6fecb8728ee7c817fb3fef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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