Created
August 28, 2020 16:45
-
-
Save btastic/c251e3f9b5699e4eb445e1245cc3ba72 to your computer and use it in GitHub Desktop.
MoveCodes
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
const std::string moveCodes[18] = { | |
"R", | |
"L", | |
"B", | |
"F", | |
"U", | |
"D", | |
"R2", | |
"L2", | |
"B2", | |
"F2", | |
"U2", | |
"D2", | |
"R'", | |
"L'", | |
"B'", | |
"F'", | |
"U'", | |
"D'", | |
}; | |
std::string getMoveByCode(int code) { | |
return moveCodes[code]; | |
} | |
int getMoveCode(std::string move) { | |
for (int i = 0; i < sizeof(moveCodes); i++) { | |
if (moveCodes[i] == move) { | |
return i; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment