这可能是一个非常新手的问题,但我只是在练习 C++ 的课程,似乎无法让这个 do while 循环在布尔条件下结束。
int main()
{
bool endgame = false;
string x;
int choice;
cout << "please choose the colour you want your bow to be:\n";
cin >> x;
Bow bow1(x);
do
{
cout << "please choose what you would like to do\n";
cout << "(1 draw bow\n(2 fire bow\n(3 end game";
cin >> choice;
if (choice == 1)
{
bow1.Draw();
}
else if (choice == 2)
{
bow1.Fire();
}
else
{
endgame = true;
}
}
while (choice > 0 || choice < 3 || endgame == true);
return 0;
}