Hi im building a simple game in c (im new to the language). Im using the following structs:
typedef struct
{
int adjacent_mines;
bool revealed;
bool is_mine;
} Tile;
struct GameState
{
Tile tiles[NUM_TILES_X][NUM_TILES_Y];
};
typedef struct GameState GameState;
Im wondering how to properly call and set the structs? I have the following code where i would like to set state of each Tile.
void intialize_mines(){
for (int i =0; i < NUM_TILES_X; i++){
for (int j =0; j < NUM_TILES_Y; j++){
tiles[i,j].revealed = false;
}
}
}
But according to my console output i have done this incorrectly. How would i go about setting this correctly?