Пример #1
0
 begain()/*游戏开始画面*/ 
{ 
 int i,j; 
 loop: cleardevice(); 
 MouseOn(); 
 MouseSetXY(180,30); 
 MouseX=180; 
 MouseY=30; 
 scorenum=0; 
 setfillstyle(SOLID_FILL,7); 
 bar(190,60,390,290); 
 setfillstyle(SOLID_FILL,8); 
 for(i=100;i<300;i+=20)/*画格子*/ 
  for(j=200;j<400;j+=20) 
   bar(j-8,i+8,j+8,i-8); 
 setcolor(7); 
 setfillstyle(SOLID_FILL,YELLOW);/*画脸*/ 
 fillellipse(290,75,10,10); 
 setcolor(YELLOW); 
 setfillstyle(SOLID_FILL,0); 
  fillellipse(285,75,2,2); 
  fillellipse(295,75,2,2); 
 setcolor(0); 
  bar(287,80,293,81); 
 randomize(); 
 for(i=0;i<10;i++) 
  for(j=0;j<10;j++) 
   { 
   num[i][j]=random(7)+10;/*用10代表地雷算了*/ 
   if(num[i][j]==10) 
    scorenum++; 
   } 
 sprintf(score,"%d",scorenum);
 setcolor(1); 
 settextstyle(0,0,2); 
 outtextxy(210,70,score); 
 scorenum=100-scorenum;/*为了后面判断胜利*/
 return 0;
}
Пример #2
0
CLIPPER MOn()        { MouseOn( _parni( 1 ) ); }