src/game.c

changeset 31
ed440bcd9740
parent 30
a285ee393860
child 32
8a0b85303ee8
equal deleted inserted replaced
30:a285ee393860 31:ed440bcd9740
152 152
153 static int domove_singlemachine(GameState *gamestate, GameInfo *gameinfo) { 153 static int domove_singlemachine(GameState *gamestate, GameInfo *gameinfo) {
154 154
155 const size_t buflen = 8; 155 const size_t buflen = 8;
156 char movestr[buflen]; 156 char movestr[buflen];
157 movestr[0] = '\0';
157 158
158 int inputy = getmaxy(stdscr) - 6; 159 int inputy = getmaxy(stdscr) - 6;
159 while (1) { 160 while (1) {
160 draw_time(gamestate, gameinfo); 161 draw_time(gamestate, gameinfo);
161 move(inputy, 0); 162 move(inputy, 0);
203 default: 204 default:
204 eval_move_failed_msg(eval_result); 205 eval_move_failed_msg(eval_result);
205 } 206 }
206 clrtoeol(); 207 clrtoeol();
207 } 208 }
209 movestr[0] = '\0'; /* reset string for next input */
208 } 210 }
209 } 211 }
210 } 212 }
211 213
212 static int sendmove(GameState *gamestate, int opponent) { 214 static int sendmove(GameState *gamestate, int opponent) {

mercurial