/* Ancienne méthode : */ if (touche_appuyee == '9') { if (matrice[9] == ' ') { matrice[9] = 'X'; } else { faute = true; } } //etc... /* Nouvelle méthode */ touche_appuyee -= '0'; if (touche_appuyee < 0 || touche_appuyee > 9) { /* Erreur : pas un chiffre */ } else { if (matrice[touche_appuyee] == ' ') { /* etc... */ } }