#include <stdio.h>
char i = 0, a = 0;
int col, sw = 0;
int fil;

void main () {
      clrscr ();
      fflush (stdin);
      gotoxy (10, 10);
      printf ("Mueve cursor:");
      while (sw == 0) {
     /*gotoxy(wherex(),wherey());*/
	i = getche ();
      	col = wherex ();
      	col--;
      	fil = wherey ();
      	if (i == 0) {
	/*	  //printf("dentro de i=0");*/
        a = getch ();
	switch (a) {
	      case 72: {
                gotoxy (col, fil - 1);
/*				// printf("col= %d, fil= %d",col,fil);*/

	/*	// getch();*/

		  break;
		

	      }
	      

	    case 80:
	      

		gotoxy (col, fil + 1);
	      

		break;
	      

	    case 77:
	      

		gotoxy (col + 1, fil);
	      

		break;
	      

	    case 75:
	      

		gotoxy (col - 1, fil);
	      

		break;
	      

	    }
	  

}
      

	else
	

	  sw = 1;
      

    }
  

    printf ("fin");
  

    getch ();
  

    fflush (stdin);
  

    clrscr ();
  

    

}


