- 1
- 0
- 约9.1千字
- 约 14页
- 2018-07-20 发布于江苏
- 举报
俄罗斯方块c语言程序带注释3
//#include STDIO.H //#include conio.c #include time.H #include stdlib.H#include windows.h#include iostreamusing namespace std;#define key_left 75 #define key_right 77 #define key_up 72 #define key_down 80 #define space 32 /*全局变量。方块。背景数组*/ int background[20][10]; /*int fang_kuai[2][2]={1,1, 1,1,};*/ int fang_kuai[7][4][4][4]={ 1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,1,1,1,1, 0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,1,1,1,0,0,1,0,0, 0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,1,1,1,0,0,0,0,0, 0,0,0,0,1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1,1,1,0,1,0,0,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,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0, 1,0,0,0,1,1,0,0,0,0,0,0,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0, 1,1,0,0,0,0,0,0,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,1,0,0,0, 0,0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,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,0,0,0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0, 1,1,0,0,0,0,0,0,0,0,0,0,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,1,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0, 0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0, 1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0, }; /*方块模板*/ int shape,dir,next_shape,next_dir; struct position { int x; int y; } now_position; /*纪录现在方块的位置*/ int speed_level=1; int fall_to_land,be_lined; /*判断方块是否着地的*/ /*----------------------------------------*/ void clscreen(); void setxy(int x,int y); void display_back(); void display_interface(); void display_fk(int x,int y,int shape,int dir); void init(); //int getkey();/*取键盘的扫描码*/ void getinput(); void m_sound(int freq,int time); void eras_fk(int x,int y,int shape,int dir);/*擦除方块*/ void fk_down(bool quickly = false); bool is_illegal(int x,int y,int changed_dir);/*判断方块移动后坐标
您可能关注的文档
- 供沪动物单位申报材料5.doc
- 供水工程环境保护监理实施细则6.doc
- 供电局毕业实习工作日志6.doc
- 供电局电网预防雨雪冰冻灾害应急预案6.doc
- 依托标准促进开烤烟可持续发展.doc
- 依法保护人类共有的家园可用4.ppt
- 依法治国背景下对深化实化见义勇为法制化推进的思考4.doc
- 依法治国是我国宪法确定的治国方略,是社会主义法治理9.doc
- 依法纳税是公民的基本义务4.ppt
- 依法行政的理论与实践(上)4.doc
- 河北盐山中学等校2025-2026学年上学期高三一模化学试卷(含解析).docx
- 河北正定中学2025-2026学年高一上学期期末考试物理试卷(含解析).docx
- 河北张家口市怀安县2025-2026学年第一学期期末教学综合评价八年级地理试卷(含解析).docx
- 河南安阳市殷都区2025-2026学年第一学期期末教学质量检测七年级地理试卷(含解析).docx
- 河南安阳市滑县2025一2026学年第一学期期末学业质量监测八年级地理试题(含解析).docx
- 河南安阳市林州市2025-2026学年上学期期末考试高一政治试题(含解析).docx
- 河南焦作市武陟县第一中学2025-2026学年高一上学期1月月考语文试卷(含解析).docx
- 河南济源市2025-2026学年上学期期末学业质量调研七年级历史试卷(含解析).docx
- PICC导管并发症的紧急处理与护理.pptx
- 河南鹤壁市2025-2026学年高二上学期期末考试生物试题(含解析).docx
原创力文档

文档评论(0)