Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void f(int field_size)
- {
- bool victory = false;
- for (size_t x = 0; x < field_size; ++x)
- {
- unsigned total_in_column = 0, total_in_line = 0;
- for (size_t y = 0; y < field_size; ++y)
- {
- if (tiles[x + y*field_size].state == PLAYER_STATE::TURN) ++total_in_column;
- if (tiles[y + x*field_size].state == PLAYER_STATE::TURN) ++total_in_line;
- }
- if (total_in_column == field_size || total_in_line == field_size)
- {
- victory = true;
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement