Last active
June 18, 2019 21:46
-
-
Save Shaddyjr/d75d4367f74ce2cce2380a6f0d66e09b to your computer and use it in GitHub Desktop.
This file contains hidden or 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 dirReduc(arr): | |
directions = { | |
"NORTH" : "SOUTH" , | |
"SOUTH" : "NORTH" , | |
"WEST" : "EAST" , | |
"EAST" : "WEST" | |
} | |
for i in range(len(arr)-1): | |
move = arr[i] | |
next_move = arr[i+1] | |
if (next_move == directions[move]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment