vurhorston
29-03-2009, 13:28
برای مشاهده محتوا ، لطفا وارد شوید یا ثبت نام کنید #include<iostream>
#include<conio.h>
int main()
{
int x=10 ,y=10;
dir='a';
cout<<"press Enter to quit";
cout<<"use n,s,w,e to go north,south,west & east";
while(dir != '/r')
{
dir=getche();
if(dir =='n')
y--;
else
if(dir=='s')
y++;
else
if(dir=='e')
x++;
else
if(dir=='w')
x--;
}
getch();
return 0;
]
#include<conio.h>
int main()
{
int x=10 ,y=10;
dir='a';
cout<<"press Enter to quit";
cout<<"use n,s,w,e to go north,south,west & east";
while(dir != '/r')
{
dir=getche();
if(dir =='n')
y--;
else
if(dir=='s')
y++;
else
if(dir=='e')
x++;
else
if(dir=='w')
x--;
}
getch();
return 0;
]