51单片机俄罗斯方块源代码
代码说明:
# include # include # define N 4 # define time 500 # define uchar unsigned char sbit keyenable=P3^6; sbit up=P3^2; sbit down=P3^4; sbit right=P3^3; sbit left=P3^1; uchar code table[N+8]={0,0,0,0,1,2,4,8,16,32,64,128}; char x[4]; char y[4]; char m[8][8]={0}; uchar p[8]; int n=0; /************** 延时函数 ***************/ void delay(char MS) { char us,usn; while(MS!=0) { usn = 0; while(usn!=0) { us=0xff; while (us!=0){us--;}; usn--; } MS--; } } /*************** 判断是否碰撞函数 **************/ bit coll(void) { bit k=0; int i; for(i=0;i
下载说明:请别用迅雷下载,失败请重下,重下不扣分!