#include <iostream>
usingnamespace std;
char moveto;
void z()
{
cout<<"You are now standing on z. Were do you want to move?\n";
cout<<"[q][w][e]\n[a][s][d]\n[0][x][c]\n";
cin>> moveto;
}
void x()
{
cout<<"You are now standing on x. Were do you want to move?\n";
cout<<"[q][w][e]\n[a][s][d]\n[z][0][c]\n";
cin>> moveto;
}
void c()
{
cout<<"You are now standing on c. Were do you want to move?\n";
cout<<"[q][w][e]\n[a][s][d]\n[z][x][0]\n";
cin>> moveto;
}
void a()
{
cout<<"You are now standing on a. Were do you want to move?\n";
cout<<"[q][w][e]\n[0][s][d]\n[z][x][c]\n";
cin>> moveto;
}
void s()
{
cout<<"You are now standing on s. Were do you want to move?\n";
cout<<"[q][w][e]\n[a][0][d]\n[z][x][c]\n";
cin>> moveto;
}
void d()
{
cout<<"You are now standing on d. Were do you want to move?\n";
cout<<"[q][w][e]\n[a][s][0]\n[z][x][c]\n";
cin>> moveto;
}
void q()
{
cout<<"You are now standing on q. Were do you want to move?\n";
cout<<"[0][w][e]\n[a][s][d]\n[z][x][c]\n";
cin>> moveto;
}
void w()
{
cout<<"You are now standing on w. Were do you want to move?\n";
cout<<"[q][0][e]\n[a][s][d]\n[z][x][c]\n";
cin>> moveto;
}
void e()
{
cout<<"You are now standing on e. Were do you want to move?\n";
cout<<"[q][w][0]\n[a][s][d]\n[z][x][c]\n";
cin>> moveto;
choosevoid;
}
void choosevoid()
{
switch ( moveto ) {
case'z':
z();
break;
case'x':
x();
break;
case'c':
c();
break;
case'a':
a();
break;
case's':
s();
break;
case'd':
d();
break;
case'q':
q();
break;
case'w':
w();
break;
case'e':
e();
break;
}
}
int main()
{
cout<<"You are standing on s. Were do you want to move?\n";
cout<<"[q][w][e]\n[a][0][d]\n[z][x][c]\n";
cin>> moveto;
cin.get();
switch ( moveto ) {
case'z':
z();
break;
case'x':
x();
break;
case'c':
c();
break;
case'a':
a();
break;
case's':
s();
break;
case'd':
d();
break;
case'q':
q();
break;
case'w':
w();
break;
case'e':
e();
break;
}
}
I have probably done this wrong, but I want it to go back and let you choose again after the first time you choose. Anyone know what is wrong?
just judging by what you just said and not reading your code much because im lazy ha, i'd say you just need to put everything inside main and call main with main();