Recorre una palabra por la pantalla segun las teclas a,w,s,d
c:
#include <conio.h>
#include <stdio.h>
#include <dos.h>
main()
{
char nombre[] = "Victor De la Rocha";
char letra;
int x,y;
clrscr();
x=72;
y=15;
do
{
clrscr();
gotoxy(x,y);
printf("%s",nombre);
letra=getch();
switch(letra)
{
case 72:
if(y>1)
y--; break;
case 75:
if(x>1)
x--; break;
case 77:
if(x<75)
x++; break;
case 80:
if(y<24)
y++; break;
}
}while(letra!=27);
getch();
return 0;
}
#include <stdio.h>
#include <dos.h>
main()
{
char nombre[] = "Victor De la Rocha";
char letra;
int x,y;
clrscr();
x=72;
y=15;
do
{
clrscr();
gotoxy(x,y);
printf("%s",nombre);
letra=getch();
switch(letra)
{
case 72:
if(y>1)
y--; break;
case 75:
if(x>1)
x--; break;
case 77:
if(x<75)
x++; break;
case 80:
if(y<24)
y++; break;
}
}while(letra!=27);
getch();
return 0;
}