spelling
authorMazet Laurent <mazet@softndesign.org>
Tue, 4 Jun 2024 21:25:20 +0000 (23:25 +0200)
committerMazet Laurent <mazet@softndesign.org>
Tue, 4 Jun 2024 21:25:20 +0000 (23:25 +0200)
battleships.c

index 60093c06ba713cf7d5e7f362d3344a97e8b3dc5f..423b17052fb2e9627b330a3ce4d3ee8f9710a722 100644 (file)
@@ -255,13 +255,13 @@ int main (int argc, char *argv[])
                 if (length == 0) {
                     x = y = orient = 0;
                     if (!findlocation (boardcomputer, 1, &x, &y, &orient, " S")) {
-                        VERBOSE (WARNING, fprintf (stderr, "can't position for bomb %d\n", 1));
+                        VERBOSE (WARNING, fprintf (stderr, "can't find position for bomb %d\n", 1));
                         stop = 1;
                     }
                     displaylog (logs, "Send bomb on computer board", xlogs, ylogs);
                 } else {
                     if (!findlocation (boardhuman, length, &x, &y, &orient, " ")) {
-                        VERBOSE (WARNING, fprintf (stderr, "can't position for boat %d\n", length));
+                        VERBOSE (WARNING, fprintf (stderr, "can't find position for boat %d\n", length));
                         stop = 1;
                     }
                 }
@@ -270,7 +270,7 @@ int main (int argc, char *argv[])
                     displaylog (logs, "Computer ship hitted", xlogs, ylogs);
                 }
                 if (!findlocation (boardcomputer, 1, &x, &y, &orient, " S")) {
-                    VERBOSE (WARNING, fprintf (stderr, "can't position for bomb %d\n", 1));
+                    VERBOSE (WARNING, fprintf (stderr, "can't find position for bomb %d\n", 1));
                     stop = 1;
                 }
                 if (testsunk (boardcomputer)) {
@@ -321,6 +321,7 @@ int main (int argc, char *argv[])
 /* test: battleships.exe -v 2>&1 | grep missing */
 /* test: echo q | battleships.exe -v 4 | grep "debug mode" */
 /* test: battleships.exe _ 2>&1 | grep invalid */
+/* test: echo -e 'ppppdpdpdpdpdpdpdpq' | battleships.exe */
 /* test: echo -e '\n\n\n\n\t\nklllkkij \n\n\n\n\n \n\njjjkkil\n\t\n\nllk kji\n\t\nq' | battleships.exe */
 /* test: (for i in `seq 1 210`; do echo -n p; done; echo q) | battleships.exe */