EditBoard: use printf for conciseness
[gnushogi.git] / gnushogi / rawdsp.c
index 0ca5c5a..54bb7a1 100644 (file)
@@ -342,10 +342,10 @@ Raw_EditBoard(void)
     Book = BOOKFAIL;
     Raw_ClearScreen();
     Raw_UpdateDisplay(0, 0, 1, 0);
-    fputs(".   Exit to main\n", stdout);
-    fputs("#   Clear board\n", stdout);
-    fputs("c   Change sides\n", stdout);
-    fputs("enter piece & location: \n", stdout);
+    printf(".   Exit to main\n");
+    printf("#   Clear board\n");
+    printf("c   Change sides\n");
+    printf("enter piece & location:\n");
 
     a = black;
 
@@ -385,6 +385,8 @@ Raw_EditBoard(void)
                     break;
                 }
             }
+            if (!found)
+                printf("# Invalid piece type '%c'\n", s[0]);
             continue;
         }
 
@@ -392,6 +394,7 @@ Raw_EditBoard(void)
         r = ROW_NUM(s[2]);
 
         if ((c < 0) || (c >= NO_COLS) || (r < 0) || (r >= NO_ROWS)) {
+            printf("# Out-of-board position '%c%c'\n", s[1], s[2]);
             continue;
         }
 
@@ -411,6 +414,9 @@ Raw_EditBoard(void)
                 break;
             }
         }
+
+        if (!found)
+            printf("# Invalid piece type '%c'\n", s[0]);
     }
 
     for (sq = 0; sq < NO_SQUARES; sq++)