commit d78b7c8a7777166eaf3d8dc476eb59899d30e1e9 Author: 18408000525 <18408000525@edu.hut.stu.com> Date: Wed Jan 9 21:34:32 2019 +0800 mfirst commit diff --git a/嘻嘻嘻俄罗斯方块吃柠檬.c b/嘻嘻嘻俄罗斯方块吃柠檬.c new file mode 100644 index 0000000..9d46cf8 --- /dev/null +++ b/嘻嘻嘻俄罗斯方块吃柠檬.c @@ -0,0 +1,273 @@ +#include +#include +#include +#include +#include +#include + +#define N 20 +#define M 16 +int cur_x,cur_y; +int score,mark,next,map[N][M],Gamespeed=400; +int shape[28][6]= +{ + {0,-1,0,-2,1,0}, {0,1,1,0,2,0}, {-1,0,0,1,0,2}, {0,-1,-1,0,-2,0}, + {0,-1,0,1,-1,0}, {0,1,1,0,-1,0}, {1,0,0,-1,0,1}, {1,0,-1,0,0,-1}, + {-1,1,0,1,1,0}, {0,-1,1,0,1,1}, {-1,0,0,-1,1,-1}, {-1,-1,-1,0,0,1}, + {-1,0,0,1,1,1}, {0,1,1,-1,1,0}, {-1,0,0,1,1,1}, {0,1,1,-1,1,0}, + {-1,0,0,-1,0,-2}, {-1,0,-2,0,0,1}, {0,1,0,2,1,0}, {0,-1,1,0,2,0}, + {0,1,1,0,1,1}, {0,-1,1,0,1,-1}, {-1,0,0,-1,-1,-1}, {-1,0,-1,1,0,1}, + {0,1,0,2,0,3}, {1,0,2,0,3,0}, {0,-1,0,-2,0,-3}, {-1,0,-2,0,-3,0} +}; +void Init(int id); +void PrintPrompting();//ʾʾϢ +void YourScore(); +void GotoxyWithFullwidth(short x, short y);//ȫ +void Gameover(); +void ShowMap(int id); + + +void GotoxyWithFullwidth(short x, short y)//ȫǶλ +{ + static COORD cd;//궨 + cd.X = (short)(x << 1);// + cd.Y = y; + HANDLE A_GConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE); + SetConsoleCursorPosition(A_GConsoleOutput, cd); +} +void PrintPrompting()//ʾʾϢ +{ + HANDLE A_GConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE); + SetConsoleTextAttribute(A_GConsoleOutput, 0xF); + GotoxyWithFullwidth(25, 12); + printf("ƶ "); + GotoxyWithFullwidth(25, 13); + printf("ƶ "); + GotoxyWithFullwidth(25, 14); + printf("ƶ "); + GotoxyWithFullwidth(25, 15); + printf("˳ʱת "); + GotoxyWithFullwidth(25, 16); + printf("ոͣ鵹"); + GotoxyWithFullwidth(35, 12); + printf("|ӭ ˹ ") ; + GotoxyWithFullwidth(35,13); + printf("|ԱƷ߾֮"); + GotoxyWithFullwidth(35, 14); + printf("|ɰӣ") ; + GotoxyWithFullwidth(35, 15); + printf("|˼ҲŲǴӱȣ"); + GotoxyWithFullwidth(35, 16); + printf("|Ϸ~~~~~ιιһҲ̫˰ȣ"); + GotoxyWithFullwidth(36, 30); + printf("By: һֻڽûֵС˼"); +} +void Gameover() +{//Ϸж + CONSOLE_CURSOR_INFO cursorInfo = { 1, FALSE}; + int i,j,flag=0; + for(j=1;j1;ii-- + ){ + for( jj=1;jj