资源描述:
《俄罗斯方块代码》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、俄罗斯方块C语言代码#include"windows.h"#include"iostream"#include"string"#include"stdio.h"#include"conio.h"#include"time.h"#include"cmath"usingnamespacestd;constintROW=20;constintCOL=13;//每个数组保存一种类型方块,每种类型又包括多种形状。intgraph_I[4][4][4]={1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,1
2、,1,0,0,0,0,0,0,0,0};intgraph_O[4][4][4]={0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0};intgraph_L[4][4][4]={1,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,0,0,0,0};intgraph_W[4][4][4]={0,1,0,0,1,1,1,0,0,0,0,0,
3、0,0,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0};intgraph_H[4][4][4]={1,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0};intgraph_T[4][4][4]={0,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,0,0
4、,0,0,0,1,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0};intgraph_N[2][4][4]={0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0};//动态打印"END"图样intover[ROW][COL]={{1,1,1,1,1,1,1,1,1,1,1,1,1},{1,1,1,1,1,1,1,1,1,1,1,1,1},{1,1,1,1,1,1,1,1,1,1,1,1,1}
5、,{1,1,1,1,1,1,1,1,1,1,1,1,1},{1,1,1,1,1,1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