2020-06-12 09:46:44 +08:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <ncurses.h>
|
|
|
|
|
2020-06-13 02:28:43 +08:00
|
|
|
#ifndef GRID_H
|
|
|
|
#define GRID_H
|
|
|
|
|
2020-06-12 09:46:44 +08:00
|
|
|
typedef struct Grid {
|
|
|
|
unsigned int size;
|
|
|
|
unsigned int width;
|
|
|
|
bool* arr;
|
|
|
|
} Grid;
|
|
|
|
|
|
|
|
void initGrid(Grid* grid, unsigned int width, unsigned int height);
|
|
|
|
|
2020-06-14 09:55:02 +08:00
|
|
|
unsigned int toIndex(Grid* grid, int x, int y);
|
|
|
|
|
2020-06-12 09:46:44 +08:00
|
|
|
void clearGrid(Grid* grid);
|
|
|
|
|
2020-06-14 09:55:02 +08:00
|
|
|
void updateGrid(Grid* grid);
|
|
|
|
|
2020-06-12 09:46:44 +08:00
|
|
|
void putPixel(Grid* grid, int x, int y);
|
|
|
|
|
|
|
|
void drawGrid(Grid* grid);
|
|
|
|
|
2020-06-13 02:28:43 +08:00
|
|
|
#endif
|