fix battleships

This commit is contained in:
Benno Fünfstück 2020-02-06 17:46:40 +01:00
parent 54d12f1e86
commit a1ce9d4b7a

View file

@ -232,7 +232,7 @@ void update_state(struct state * state, struct position pos) {
int letter_count = 0;
for (int x = 0; x < BOARD_SIZE; ++x) {
for (int y = 0; y < BOARD_SIZE; ++y) {
if (isalpha(state->board[pos.y][pos.x])) {
if (isalpha(state->board[y][x])) {
letter_count += 1;
}
}