so now it work?
This commit is contained in:
parent
4cf532da40
commit
0de7726160
14
main.c
14
main.c
|
@ -20,10 +20,10 @@ typedef enum GameState {
|
||||||
|
|
||||||
GameState game_state = PLAYING;
|
GameState game_state = PLAYING;
|
||||||
|
|
||||||
int game_cap = 30*16;
|
int game_cap = 16*30;
|
||||||
char game[30][16] = {0};
|
char game[16][30] = {0};
|
||||||
char discover[30][16] = {0};
|
char discover[16][30] = {0};
|
||||||
char zero[30][16] = {0};
|
char zero[16][30] = {0};
|
||||||
|
|
||||||
// I confused myself with game type, mode and diff, but it all mean the same
|
// I confused myself with game type, mode and diff, but it all mean the same
|
||||||
// TODO: refactor it
|
// TODO: refactor it
|
||||||
|
@ -204,12 +204,12 @@ void zero_click(int x, int y)
|
||||||
if (game[y][x] != '0')
|
if (game[y][x] != '0')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (int i=-1; i<=1; i++) {
|
|
||||||
if (x+i < 0 || x+i >= game_size.x)
|
|
||||||
continue;
|
|
||||||
for (int j=-1; j<=1; j++) {
|
for (int j=-1; j<=1; j++) {
|
||||||
if (y+j < 0 || y+j >= game_size.y)
|
if (y+j < 0 || y+j >= game_size.y)
|
||||||
continue;
|
continue;
|
||||||
|
for (int i=-1; i<=1; i++) {
|
||||||
|
if (x+i < 0 || x+i >= game_size.x)
|
||||||
|
continue;
|
||||||
zero_click(x+i, y+j);
|
zero_click(x+i, y+j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue