-
-
Save skorezore/8e9b445bb103149a4389 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
#include <array> | |
#include <vector> | |
enum class game_state | |
{ | |
neutral, | |
both_win, | |
x_wins, | |
o_wins | |
}; | |
enum class marker | |
{ | |
x, | |
o | |
}; | |
game_state game_status(std::array<marker, 9> game_map) | |
{ | |
// Implement this somehow | |
} | |
int main() | |
{ | |
std::array<marker, 9> game_map | |
while (true) | |
{ | |
get_input(); | |
update_map(); | |
switch (game_status(game_map_)) | |
{ | |
case x_wins : std::cout << "Player wins!" << std::endl; | |
break; | |
case o_wins : std::cout << "Computer wins!" << std::endl; | |
break; | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment