我正在尝试使用此代码,但它无法正常工作
for(int i = 0; i < message_length; i++){
char y = message[i];
if(y == '_'){
cout << " ";
}
if(y != '_' && player_choice != y && guessed_letters[i] != y){
cout << "-";
}
if(y != '_' && player_choice == y && guessed_letters[i] != y){
cout << player_choice;
}
if(y != '_' && player_choice == y && guessed_letters[i] == y){
cout << guessed_letters[i];
}
}