- x = (char)"";
- char* prompt_msg = "Prochain pion ? (ligne colonne - chiffre lettre):";
- int prmt_rt = prompt_values(stdscr, center_y + 26/2 + 1, center_x - strlen(prompt_msg)/2, prompt_msg, &y, &x);
- if (is_valid_input(y, map_col_letter_to_index(x), pawns) && prmt_rt == 1) {
+ x_char = (char)"";
+ const char* prompt_msg = "Prochain pion ? (ligne colonne - chiffre lettre):";
+ int prmt_rt = prompt_values(stdscr, center_y + 26/2 + 1, (center_x - strlen(prompt_msg)/2), prompt_msg, &y, &x_char);
+ int x = map_col_letter_to_index(x_char);
+ /* TODO: a comparaison to the linked list of playable shots is better */
+ if (is_legal_shot(y, x, player, pawns) && prmt_rt == 1) {
+ nb_pawns_reversed = valid_shot(y, x, player, pawns);