I want to save every move 'char' to an array, and then call back all arrays to see the history
cout << "=== Chose ===" << endl;
cout << "Choose were to GO" << endl;
cout << "a, w, s, or d" << endl;
cout << endl;
cin >> Сhoice_1;
if (tolower(Сhoice_1) == 'a')
{
cout << "You made a step to the left" << endl;
value1 = -1;
if (value1 < 0) break;
}
if (tolower(Сhoice_1) == 's')
{
cout << "You made a step back" << endl;
value1 = -1;
if (value1 < 0) break;
}
if (tolower(Сhoice_1) == 'w')
{
cout << "You made a step foward" << endl;
value1 = -1;
if (value1 < 0) break;
}
if (tolower(Сhoice_1) == 'd')
{
cout << "You made a step to the right" << endl;
value1 = -1;
if (value1 < 0) break;
}
if (LifeOptionMain <= 0)
{
value1 = -1;
if (value1 < 0) break;
}
I tried for loop
for (int i = 0; i < 10; i++)
{
move[i + 1];
move[i] = Сhoice_1;
}
but all elements are only one symbol, last input symbol, if last was a then output will be a a a .... what am I doing wrong??? please help.
value1
to-1
immediately afterward checking ifvalue
is less than0
seems a tad unnecessary. You could justbreak
.