Skip to content

Instantly share code, notes, and snippets.

@btastic
Created August 28, 2020 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save btastic/c251e3f9b5699e4eb445e1245cc3ba72 to your computer and use it in GitHub Desktop.
Save btastic/c251e3f9b5699e4eb445e1245cc3ba72 to your computer and use it in GitHub Desktop.
MoveCodes
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