Skip to content

Instantly share code, notes, and snippets.

@skorezore
Last active September 22, 2015 02:02
Show Gist options
  • Save skorezore/8e9b445bb103149a4389 to your computer and use it in GitHub Desktop.
Save skorezore/8e9b445bb103149a4389 to your computer and use it in GitHub Desktop.
#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