/*
问题1,光标的位置能不能隐藏?  
   原因分析:当i=25,j=79的时候,再按d,j变成了80,星星显示在了(25,80)
            但是,光标确出现在了 (26,1)的位置上,郁闷啊~~~
问题2,上下左右怎么调用?(我用了WSAD来调用)
        尤其 是右箭头怎么也显示不出来啊~~~ 更加郁闷了~~~
*/
# include <stdio.h>
# include <stdlib.h>
void prback()
 {
 int i=25,j=80;
 for(;i>0;i--)for(;j>0;j--)putchar('\b');
 }
void prspace(int i,int j)
 {int k;
 for(k=1;k<i;k++)printf("\n");
 for(k=1;k<j;k++)printf(" ");
 }
void prstar()
 {
 printf("*\b");
 
 }
/*主函数************************************/ 
main()
{
char c;
int i=1,j=1;
clrscr();
printf("press any key to access:\npress enter to exit\n");
c=getch();
while (c!='\015')
   {
   clrscr();
   switch (c)
      {
      case 'w': {
                    if(i>1)i--;
                    prspace(i,j);
                    prstar();
                    break;
                    }
      case 's': {  
                  if(i<24)i++;
                   prspace(i,j);
                    prstar();
                    break;
                    }
      case 'a': {  if(j>1)j--;
                   prspace(i,j);
                    prstar();
                    break;
                    }
      case 'd': {  if(j<80)j++;
                    prspace(i,j);
                    prstar();
                    break;
                    }
      default: break;
      }
   c=getch();
   }
}

 
											





 
	     
											
