FloodFill #2

Merged
FisionX merged 16 commits from floodfill into main 2024-08-09 18:29:49 -06:00
Showing only changes of commit 0ba516d684 - Show all commits

View File

@ -84,7 +84,25 @@ void follow(struct maze maze, class mmstats mms) {
int x = mms.x; int x = mms.x;
int y = mms.y; int y = mms.y;
int mht = maze.mhtn[x][y]; int mht = maze.mhtn[x][y];
int next[2];
if (mht > maze.mhtn[x][y+1]) {
next[0] = x;
}
}
void nextcell(int i, int j, int dir, int& nextx, int& nexty) {
switch (dir) {
case norte: j++;
break;
case este: i++;
break;
case sur: j--;
break;
case oeste: i--;
break;
}
nextx = i;
nexty = j;
} }
void updatepos(class mmstats* mms) { void updatepos(class mmstats* mms) {
@ -101,9 +119,6 @@ void updatepos(class mmstats* mms) {
case oeste: mms->x--; case oeste: mms->x--;
break; break;
} }
log(mms->x);
log(mms->y);
log("");
} }
@ -115,6 +130,7 @@ int main(int argc, char* argv[]) {
mmstats stats; mmstats stats;
stats.x = 0; stats.x = 0;
stats.y = 0; stats.y = 0;
flood(&maze, &stats); flood(&maze, &stats);
while (true) { while (true) {