fix moves (2)
authorLaurent MAZET <laurent.mazet@thalesgroup.com>
Mon, 3 Jun 2024 11:26:49 +0000 (13:26 +0200)
committerLaurent MAZET <laurent.mazet@thalesgroup.com>
Mon, 3 Jun 2024 11:26:49 +0000 (13:26 +0200)
battleships.c

index babcf06af63d2a20ef25b7f962a8d5d09dadab61..00c201959373233a58dd9321978b302f1618843b 100644 (file)
@@ -195,7 +195,7 @@ int main (int argc, char *argv[])
                 }
             } else {
                 int t;
-                for (t = y - 1; t >= 0; t--) {
+                for (t = x - 1; t >= 0; t--) {
                     if (testlocation (boardcomputer, 1, t, y, orient, " S")) {
                         x = t;
                         break;