necesito un prog q dibuje un laberinto PLEASE!!
NO SE COMO HACER Q UN USUARIO DIRIJA EL CAMINO CON LAS TECLAS DE DIRECCION ¿COMO VALIDAR ESO?
TIENE Q RECORRER TODAS LAS POSIBLES RUTAS, HASTA ENCONTRAR LA SALIDA
TIENE Q RECORRER TODAS LAS POSIBLES RUTAS, HASTA ENCONTRAR LA SALIDA
// program arrows.cpp
// programa para leer caracteres del teclado, incluyendo caracteres
// especiales, como ser las flechas direccionales.
// written in borland c++, ver 3.1
#include <iostream.h>
#include <iomanip.h>
#include <conio.h>
int main()
{
clrscr();
char a = \\'*\\';
while(a != 27) // 27 es el codigo de ESC
{
a = getch(); // cuando se lee una tecla especial recibimos dos
if(!a) // lecturas : la primera cero y la segunda un codigo
{ // ascii comun
cout << setw(20) << int(a) << \" : \" << a << endl;
a = getch();
}
cout << setw(20) << int(a) << \" : \" << a << endl << endl;
}
cout << \"end of program - good bye ! ! !\" << endl;
getch();
return 0;
}
// programa para leer caracteres del teclado, incluyendo caracteres
// especiales, como ser las flechas direccionales.
// written in borland c++, ver 3.1
#include <iostream.h>
#include <iomanip.h>
#include <conio.h>
int main()
{
clrscr();
char a = \\'*\\';
while(a != 27) // 27 es el codigo de ESC
{
a = getch(); // cuando se lee una tecla especial recibimos dos
if(!a) // lecturas : la primera cero y la segunda un codigo
{ // ascii comun
cout << setw(20) << int(a) << \" : \" << a << endl;
a = getch();
}
cout << setw(20) << int(a) << \" : \" << a << endl << endl;
}
cout << \"end of program - good bye ! ! !\" << endl;
getch();
return 0;
}
