This commit is contained in:
DarthMooMancer
2025-11-07 00:49:52 -05:00
parent 1ef6f37a49
commit a40813294e
4 changed files with 45 additions and 16 deletions
+2 -6
View File
@@ -88,18 +88,14 @@ bool Engine::process_input() {
index = ch - '1';
if(win->view[map[index].y][map[index].x] == ' ') {
win->view[map[index].y][map[index].x] = state.temp->id;
set_player();
if(state.temp->id == 'x') { state.temp = &state.player2; }
else if(state.temp->id == 'o') { state.temp = &state.player1; }
}
}
}
return true;
}
void Engine::set_player() {
if(state.temp->id == 'x') { state.temp = &state.player2; }
else if(state.temp->id == 'o') { state.temp = &state.player1; }
}
bool Engine::check_line(char id) {
for(int i : std::ranges::views::iota(0, COL)) {
if(ROW % 2 != 0) continue;