commit aef5001cb579b0956500e7bcbf361476b0169744
parent 162f10f814e0c4dbd6e87af11f32336864953fc6
Author: bsandro <email@bsandro.tech>
Date: Mon, 12 Jan 2026 21:13:42 +0200
Sunday cleanup
Diffstat:
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/sunday.c b/sunday.c
@@ -36,11 +36,11 @@ static Vec2 heat_area[] = {
ArVec2 findPossibleMines(Map *m, Vec2 nodule) {
ArVec2 mines = {0};
- for (int i=0;i<LEN(mine_area);++i) {
+ for (size_t i=0;i<LEN(mine_area);++i) {
Vec2 p = { .x=nodule.x+mine_area[i].x, .y=nodule.y+mine_area[i].y };
if (p.x>=0&&p.x<m->w&&p.y>=0&&p.y<m->h&&m->grid[p.y][p.x]=='.') {
bool ok = true;
- for (int j=0;j<LEN(heat_area);++j) {
+ for (size_t j=0;j<LEN(heat_area);++j) {
Vec2 h = { .x=p.x+heat_area[j].x, .y=p.y+heat_area[j].y };
if (h.x>=0&&h.x<m->w&&h.y>=0&&h.y<m->h&&m->grid[h.y][h.x]=='M') {
ok = false;
@@ -53,10 +53,6 @@ ArVec2 findPossibleMines(Map *m, Vec2 nodule) {
return mines;
}
-void PrintVec2(Vec2 p) {
- printf("{.x:%d,.y:%d}\n", p.x, p.y);
-}
-
int countMinesX(Map *m, int x) {
int r = 0;
for (int y=0;y<m->h;++y) {
@@ -73,15 +69,6 @@ int countMinesY(Map *m, int y) {
return r;
}
-void printMap(Map *m) {
- for (int y=0;y<m->h;++y) {
- for (int x=0;x<m->w;++x) {
- printf("%c", m->grid[y][x]);
- }
- printf("\n");
- }
-}
-
bool validateMap(Map *m, int mul) {
bool ok = true;
for (int x=0;x<m->w;++x) {