Se trata de resolver un laberinto, asi que nomas copien y peguen

- Código: Seleccionar todo
#include <stdio.h>
#include <conio2.h>
#define COLUMNA 40
#define RENGLON 17
int mostrarMapa(void);
int movimientos(void);
int terminar(void);
char mapa[RENGLON][COLUMNA] = {"****************************************",
"* * *",
"******* *********** ***************** *",
"* * * *",
"* ******************** ***** ********* *",
"* * * * *",
"****** ***************** *********** * *",
"* * * * * *",
"* ******** * ************************* *",
"* * * *",
"******************** *******************",
"* * * *",
"************ ************************* *",
"* * *",
"* *** ******** *************************",
"* * * F*",
"****************************************"};
int mostrarMapa(void)
{
int i;
int j;
int textura;
for( i=0; i<RENGLON; i++ )
{
for ( j=0; j<COLUMNA; j++ )
{
if( mapa[i][j]==42 )
textura = 178;
else if( mapa[i][j]==70 )
textura = 3;
else
textura = 32;
printf("%c",textura);
}
printf("\n");
}
return 1;
}
int movimientos(void)
{
char tecla;
int r=2;
int c=2;
long ciclos=0;
gotoxy(c,r);
textcolor(15);
printf("%c",2);
while( 1 )
{
gotoxy(1,25);
textcolor(15);
printf("Movimientos: %d",ciclos);
tecla = getch();
gotoxy(c,r);
switch( tecla )
{
case 56: //arriba 8
if( r>2 && mapa[r-2][c-1]!='*' )
{
printf(" ");
r--;
ciclos++;
}
break;
case 50: //abajo 2
if( r<RENGLON && mapa[r][c-1]!='*' )
{
printf(" ");
r++;
ciclos++;
}
break;
case 52: //izquierda 4
if( c>2 && mapa[r-1][c-2]!='*' )
{
printf(" ");
c--;
ciclos++;
}
break;
case 54: //derecha 6
if( c<COLUMNA && mapa[r-1][c]!='*' )
{
printf(" ");
c++;
ciclos++;
}
break;
}
if( c==38 && r==16 )
return 1;
gotoxy(c,r);
textcolor(15);
printf("%c",2);
}
}
int terminar(void)
{
gotoxy(1,20);
textcolor(14);
printf("Laberinto terminado\n");
printf("<presione Q para salir>\n");
while( getch()!='q' )
{}
}
int main(void)
{
mostrarMapa();
movimientos();
terminar();
}