without comments

This commit is contained in:
Nanokloon 2025-03-21 14:31:18 +01:00
parent 5648b27810
commit 5ff8392c28

View File

@ -82,7 +82,6 @@ int main(void) {
/* the **algorithm**, trace*/
while (currentCell.x != targetCell.x || currentCell.y != targetCell.y) {
//printf("test\n");
const int neighbours[4][2]={{1,0},{0,1},{0,-1},{-1,0}};
for (int i = 0; i < 4; i++) {
cell neighbourCell;
@ -93,30 +92,6 @@ int main(void) {
break;
}
}
/*int moved=0;
if (currentCell.x!=12) {
if (assignmentMatrix[currentCell.x+1][currentCell.y] < assignmentMatrix[currentCell.x][currentCell.y] && assignmentMatrix[currentCell.x+1][currentCell.y] != -1) {
currentCell.x=currentCell.x+1;
moved=1;
}
}
if (currentCell.x!=0 && moved==0) {
if (assignmentMatrix[currentCell.x-1][currentCell.y] < assignmentMatrix[currentCell.x][currentCell.y] && assignmentMatrix[currentCell.x-1][currentCell.y] != -1) {
currentCell.x=currentCell.x-1;
moved=1;
}
}
if (currentCell.y!=12 && moved==0) {
if (assignmentMatrix[currentCell.x][currentCell.y+1] < assignmentMatrix[currentCell.x][currentCell.y] && assignmentMatrix[currentCell.x][currentCell.y+1] != -1) {
currentCell.y=currentCell.y+1;
moved=1;
}
}
if (currentCell.y!=0 && moved==0) {
if (assignmentMatrix[currentCell.x][currentCell.y-1] < assignmentMatrix[currentCell.x][currentCell.y] && assignmentMatrix[currentCell.x][currentCell.y-1] != -1) {
currentCell.y=currentCell.y-1;
}
}*/
if ( isValidCrossing(&currentCell)) {
printCrossingName(currentCell.x, currentCell.y);
}