project



there are lots of errors that i cant fix :( ,im a newbie in programming,
can you please help me !!!!
###########
if u choose A,will display "you choose A ".

****************************************************
#include <iostream>
#include "windows.h"
using namespace std;

char box[20][40]={

"*********************************",
"* please choose a letter *",
"*********************************",
"* A < *",
"* B *",
"* C *",
"* D *",
"* E *",
"* *",
"*********************************"


};
int x=5,y=3;
bool running=true;
int main()
{
while (running==true)
{
system ("cls");
for (int display=0;display<10;display++)
{
cout<<box[display]<<endl;
}
system("pause>null");
if(GetAsyncKeyState(VK_DOWN))
{
int y2=y+1;
if (box[y2][x]=' ')
{
box[y][x]=' ';
y++;
box[y][x]='<';
}
}
else if(GetAsyncKeyState(VK_UP))
{
int y2=y+1;
int y1=y-1;
if (box[y2][x]=' ')
{
box[y][x]=' ';
y--;
box[y][x]='<';
}
}

}
return 0;
}
You need to include what errors you want help with. For starters, the code compiles fine, so I see no imminent "errors." We are to give guidance and better understanding, not homework answers/solutions. Also, there is a tool on the right side of this text entry box when you are posting that will give us the code in source formatting. It is this button: <>. (paste code in the middle brackets)

Now then. I CAN offer that:

1) There is no way to actually select A. (by pressing enter, whatever).
2) There is no limit on how high or low the cursor can go.
Topic archived. No new replies allowed.