){case0:if(d1==0){d1=1;lcd_pos(1,0);lcd_wdat(0x02);}elsegotoagain;break;case1:if(d2==0){d2=1;lcd_pos(1,1);lcd_wdat(0x02);}elsegotoagain;break;case2:if(d3==0){d3=1;lcd_pos(1,2);lcd_wdat(0x02);}elsegotoagain;break;case3:if(d4==0){d4=1;lcd_pos(1,3);lcd_wdat(0x02);}elsegotoagain;break;case4:if(d5==0){d5=1;lcd_pos(2,0);lcd_wdat(0x02);}elsegotoagain;break;case5:if(d6==0){d6=1;lcd_pos(2,1);lcd_wdat(0x02);}elsegotoagain;break;case6:if(d7==0){d7=1;lcd_pos(2,2);lcd_wdat(0x02);}elsegotoagain;break;case7:if(d8==0){d8=1;lcd_pos(2,3);lcd_wdat(0x02);}elsegotoagain;break;default:break;}/***若该位置已有地鼠,则再回到again位置再出现一次随机数,直到不重复为止*/}}Showone函数用在定时器0中,每隔一段时间就出现一只地鼠9/*定时器1中断计时,计算地鼠存在的时间*/解释一下showtime和et,这两个变量分别作为地鼠出现频率和消失快慢的控制变量。打地鼠的函数:这里要强调的就是按键松开时候的抖动问题,最初调试程序的时候总是陷在这里。while(gstart){keyscan();/*主循环,不断扫描键盘*/}10