diff --git "a/\344\277\204\347\275\227\346\226\257\346\226\271\345\235\227Plus/\346\270\270\346\210\217\346\272\220\347\240\201.txt" "b/\344\277\204\347\275\227\346\226\257\346\226\271\345\235\227Plus/\346\270\270\346\210\217\346\272\220\347\240\201.txt" index e3240e7..48b8727 100644 --- "a/\344\277\204\347\275\227\346\226\257\346\226\271\345\235\227Plus/\346\270\270\346\210\217\346\272\220\347\240\201.txt" +++ "b/\344\277\204\347\275\227\346\226\257\346\226\271\345\235\227Plus/\346\270\270\346\210\217\346\272\220\347\240\201.txt" @@ -1,25 +1,25 @@ -#include //用于getch() +#include //鐢ㄤ簬getch锛堬級 #include #include -#include //用于rand +#include //鐢ㄤ簬rand #include #include #include -//■□ +//鈻犫枴 /*------------------------- -程序名: 俄罗斯方块Tetris Plus -程序作者: 404name -日志: -·人物移动格外算时间,有下降加快更新,上升同样,这时候不算随机数,平常走动随机数 -·win画面更新。开头介绍,胜利。下降时间控制 +绋嬪簭鍚嶏細 淇勭綏鏂柟鍧桾etris Plus +绋嬪簭浣滆咃細 404name +鏃ュ織锛 +路浜虹墿绉诲姩鏍煎绠楁椂闂达紝鏈変笅闄嶅姞蹇洿鏂帮紝涓婂崌鍚屾牱锛岃繖鏃跺欎笉绠楅殢鏈烘暟锛屽钩甯歌蛋鍔ㄩ殢鏈烘暟 +路win鐢婚潰鏇存柊銆傚紑澶翠粙缁嶏紝鑳滃埄銆備笅闄嶆椂闂存帶鍒 -----------------------*/ int map[500][500] = {0}; int color_map[500][500] = {0}; int check_sum[500][2] = {0}; int if_full; -//下标按顺序为 总分 应该下降的层数 -//逻辑顺序是谁 check_sun储存对应map层数的和,当满的时候,他向上的有值的层数就要增加相应的该降层数。 +//涓嬫爣鎸夐『搴忎负 鎬诲垎 搴旇涓嬮檷鐨勫眰鏁 +//閫昏緫椤哄簭鏄皝 check_sun鍌ㄥ瓨瀵瑰簲map灞傛暟鐨勫拰锛屽綋婊$殑鏃跺欙紝浠栧悜涓婄殑鏈夊肩殑灞傛暟灏辫澧炲姞鐩稿簲鐨勮闄嶅眰鏁般 int height, width, top; int start_x, start_y, tx, ty, x, y, times, cnt_time, old_index0, index0; int if_change, if_death, reduce_time; @@ -29,24 +29,24 @@ int now_color, next_color, next_next_color; int man_x, man_y, v, man_up_down; char man_top_right[3], man_buttom_left[3], man_top_left[3], man_buttom_right[3]; -char commom_man[5][3] = { // 0ω0 - {"Θ"}, //老头 - {"Θ"}, - {"老"}, - {"头"}}; +char commom_man[5][3] = { // 0蠅0 + {"螛"}, //鑰佸ご + {"螛"}, + {"鑰"}, + {"澶"}}; char going_to_die_man[5][3] = { // - {"凉"}, // - {"凉"}, - {"老"}, - {"头"}}; + {"鍑"}, // + {"鍑"}, + {"鑰"}, + {"澶"}}; int death_line = 8; char message[7][20] = { {"[][][][][]"}, {"[Tetris ]"}, {"[ plus]"}, - {"[俄罗斯 ]"}, - {"[方块plus]"}, + {"[淇勭綏鏂 ]"}, + {"[鏂瑰潡plus]"}, {"[][][][][]"}}; struct Pass { @@ -197,13 +197,13 @@ struct Pass {"0101010101"}}}}; int now_pass; -int T[30][4] = { //7种4*4状态,对应的数据是4位数对应4种情况(有效数前面不能为零不然会认为其他进制) +int T[30][4] = { //7绉4*4鐘舵侊紝瀵瑰簲鐨勬暟鎹槸4浣嶆暟瀵瑰簲4绉嶆儏鍐碉紙鏈夋晥鏁板墠闈笉鑳戒负闆朵笉鐒朵細璁や负鍏朵粬杩涘埗锛 {0000, 1011, 0000, 0000}, //T {1101, 1111, 111, 0000}, {0000, 1110, 0000, 0000}, {0000, 0000, 0000, 0000}, - {0000, 0000, 0000, 0000}, //田 + {0000, 0000, 0000, 0000}, //鐢 {0000, 1111, 1111, 0000}, {0000, 1111, 1111, 0000}, {0000, 0000, 0000, 0000}, @@ -213,22 +213,22 @@ int T[30][4] = { //7 {101, 0000, 0000, 0000}, {101, 0000, 0000, 0000}, - {1000, 1010, 1, 0000}, //右L + {1000, 1010, 1, 0000}, //鍙矻 {101, 1111, 101, 0000}, {100, 1010, 10, 0000}, {0000, 0000, 0000, 0000}, - {0001, 1010, 10, 0000}, //左L + {0001, 1010, 10, 0000}, //宸 {101, 1111, 101, 0000}, {1000, 1010, 100, 0000}, {0000, 0000, 0000, 0000}, - {0000, 1111, 101, 0000}, //右与 + {0000, 1111, 101, 0000}, //鍙充笌 {101, 1111, 1010, 0000}, {0000, 0000, 1010, 0000}, {0000, 0000, 0000, 0000}, - {101, 1111, 0000, 0000}, //左与 + {101, 1111, 0000, 0000}, //宸︿笌 {1010, 1111, 101, 0000}, {1010, 0000, 0000, 0000}, {0000, 0000, 0000, 0000}}; @@ -239,13 +239,13 @@ void init_brick(); void death_line_drop(int turn); void man_move(); void check(); -void HideCursor() //光标隐藏 +void HideCursor() //鍏夋爣闅愯棌 { - CONSOLE_CURSOR_INFO cursor_info = {1, 0}; //后边的0代表光标不可见 + CONSOLE_CURSOR_INFO cursor_info = {1, 0}; //鍚庤竟鐨0浠h〃鍏夋爣涓嶅彲瑙 SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info); } -void gotoxy(int x, int y) //坐标函数 +void gotoxy(int x, int y) //鍧愭爣鍑芥暟 { HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); COORD pos; @@ -268,10 +268,10 @@ void init_brick() next_turn = next_next_turn; next_next_turn = rand() % 7; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), next_color); - show_next = 1; //打印下下个 + show_next = 1; //鎵撳嵃涓嬩笅涓 show(1, 1, 1, 1); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), next_next_color); - show_next = 2; //打印下个 + show_next = 2; //鎵撳嵃涓嬩釜 show(1, 1, 1, 1); show_next = 0; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), now_color); @@ -283,7 +283,7 @@ void init_brick() void init(int pass0) { int i, j; - HideCursor(); //隐藏光标 + HideCursor(); //闅愯棌鍏夋爣 system("cls"); times = 500; cnt_time = 0; @@ -305,7 +305,7 @@ void init(int pass0) strcpy(man_top_right, commom_man[1]); strcpy(man_buttom_left, commom_man[2]); strcpy(man_buttom_right, commom_man[3]); - //游戏开始样式 + //娓告垙寮濮嬫牱寮 for (i = 0; i <= height; i++) { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), rand() % 8 + 1); @@ -313,9 +313,9 @@ void init(int pass0) { gotoxy(j, i); if (i == 0 || i == height || j == 0 || j == width - 1) - printf("■"); + printf("鈻"); else - printf("□"); + printf("鈻"); } } gotoxy(6, height / 2 - 2); @@ -323,9 +323,9 @@ void init(int pass0) gotoxy(6, height / 2); printf("[Start game]"); getchar(); - //点击开始 + //鐐瑰嚮寮濮 gotoxy(0, 0); - //构建地图 + //鏋勫缓鍦板浘 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3); for (i = 0; i <= height; i++) { @@ -350,14 +350,14 @@ void init(int pass0) { printf("[]"); } - //这里是从17行开始打印8行关卡。 + //杩欓噷鏄粠17琛屽紑濮嬫墦鍗8琛屽叧鍗° else if (i >= (height - 8) && pass[pass0 - 1].ss[i - (height - 8)][j / 2 - 1] != '0' && pass0 != 0) { if (pass[pass0 - 1].ss[i - (height - 8)][j / 2 - 1] == '1') { map[i][j] = 2; check_sum[i][0] += 2; - printf("■"); + printf("鈻"); } else if (pass[pass0 - 1].ss[i - (height - 8)][j / 2 - 1] == '2') { @@ -422,10 +422,10 @@ void end() gotoxy(j, i); if (i == 0 || i == height || j == 0 || j == width - 1) { - printf("■"); + printf("鈻"); } else - printf("□"); + printf("鈻"); } Sleep(50); } @@ -451,38 +451,38 @@ void gameover() gotoxy(j, i); if (i == 0 || i == height || j == 0 || j == width - 1) { - printf("■"); + printf("鈻"); } else - printf("□"); + printf("鈻"); } Sleep(50); } gotoxy(2, height / 2 - 6); - printf(" !!!恭喜!!! "); + printf(" 锛侊紒锛佹伃鍠滐紒锛侊紒 "); getchar(); gotoxy(2, height / 2 - 4); - printf(" !!!恭喜!!! "); + printf(" 锛侊紒锛佹伃鍠滐紒锛侊紒 "); getchar(); gotoxy(2, height / 2 - 2); - printf(" 神奇!居然通关了 "); + printf(" 绁炲锛佸眳鐒堕氬叧浜 "); getchar(); gotoxy(2, height / 2); - printf(" 想要解锁更多关卡 "); + printf(" 鎯宠瑙i攣鏇村鍏冲崱 "); getchar(); gotoxy(2, height / 2 + 2); - printf(" 可以期待后续更新 "); + printf(" 鍙互鏈熷緟鍚庣画鏇存柊 "); getchar(); gotoxy(2, height / 2 + 4); - printf(" 也可以自己去魔改 "); + printf(" 涔熷彲浠ヨ嚜宸卞幓榄旀敼 "); getchar(); gotoxy(2, height / 2 + 6); - printf(" 游戏到此结束 "); + printf(" 娓告垙鍒版缁撴潫 "); getchar(); system("cls"); exit(0); } -void death_line_drop(int turn) //0对应下降 1对应打印 +void death_line_drop(int turn) //0瀵瑰簲涓嬮檷 1瀵瑰簲鎵撳嵃 { int i; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3); @@ -521,7 +521,7 @@ void death_line_drop(int turn) //0 void delete_line() { int i, j, temp = 0; - HideCursor(); //隐藏光标 + HideCursor(); //闅愯棌鍏夋爣 for (i = height - 1; i >= death_line; i--) { if (check_sum[i][0] == 20) @@ -539,7 +539,7 @@ void delete_line() } } man_x += temp; - //下降 + //涓嬮檷 for (i = height - 1; i >= death_line; i--) { if (check_sum[i][1]) @@ -550,7 +550,7 @@ void delete_line() for (j = 2; j <= width - 2; j = j + 2) { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color_map[i][j]); - map[i][j] == 2 ? printf("■") : printf(" "); + map[i][j] == 2 ? printf("鈻") : printf(" "); map[i + check_sum[i][1]][j] = map[i][j]; } gotoxy(2, i); @@ -703,7 +703,7 @@ void man_move() SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), now_color); } -int show(int out, int in, int if_auto, int class0) //是否清除 是否加载 是否自动下落 赋值类型(1在移动 2定位的) +int show(int out, int in, int if_auto, int class0) //鏄惁娓呴櫎 鏄惁鍔犺浇 鏄惁鑷姩涓嬭惤 璧嬪肩被鍨嬶紙1鍦ㄧЩ鍔 2瀹氫綅鐨勶級 { int i, j; int temp_x; @@ -723,7 +723,7 @@ int show(int out, int in, int if_auto, int class0) // now_turn = (show_next == 2 ? next_next_turn : next_turn); tx = x, ty = y; } - if (out == 1) //清除 + if (out == 1) //娓呴櫎 { for (i = tx; i < tx + 4; i++) { @@ -746,9 +746,9 @@ int show(int out, int in, int if_auto, int class0) // } } } - if (in == 1) //打印 + if (in == 1) //鎵撳嵃 { - int now_turn_index = now_turn * 4, ttx, tty; //对应到的初始下标 + int now_turn_index = now_turn * 4, ttx, tty; //瀵瑰簲鍒扮殑鍒濆涓嬫爣 for (i = x; i < x + 4; i++) { for (j = y; j < y + 4; j++) @@ -768,9 +768,9 @@ int show(int out, int in, int if_auto, int class0) // color_map[i][2 * j - y] = now_color; } if (!(class0 == 2 && i <= death_line)) - printf("■"); + printf("鈻"); } - else if (i <= height && 2 * j - y <= width && get_index0_num(T[i - x + now_turn_index][j - y], index0) == 1 && map[i][2 * j - y] == 2 && if_auto == 1) //失败则回退 + else if (i <= height && 2 * j - y <= width && get_index0_num(T[i - x + now_turn_index][j - y], index0) == 1 && map[i][2 * j - y] == 2 && if_auto == 1) //澶辫触鍒欏洖閫 { if (show_first) { @@ -785,7 +785,7 @@ int show(int out, int in, int if_auto, int class0) // show(1, 1, 1, 1); return 0; } - else if (i <= height && 2 * j - y <= width && get_index0_num(T[i - x + now_turn_index][j - y], index0) == 1 && map[i][2 * j - y] == 2) //失败则回退 + else if (i <= height && 2 * j - y <= width && get_index0_num(T[i - x + now_turn_index][j - y], index0) == 1 && map[i][2 * j - y] == 2) //澶辫触鍒欏洖閫 { ttx = tx; tty = ty; @@ -838,7 +838,7 @@ void check() SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), now_color); } -void manchange() //人为输入更新 +void manchange() //浜轰负杈撳叆鏇存柊 { char ch, ch1, ch2; if (kbhit()) @@ -847,7 +847,7 @@ void manchange() // if (ch != ' ' && ch != 'w' && ch != 's' && ch != 'a' && ch != 'd' && ch != -32 && ch != 'p' && ch != 'b') return; if (ch == -32) - { //同时启用wasd 和上下左右键 + { //鍚屾椂鍚敤wasd 鍜屼笂涓嬪乏鍙抽敭 ch1 = getch(); switch (ch1) { @@ -893,13 +893,13 @@ void manchange() // } } } -void autochange() //自动更新 +void autochange() //鑷姩鏇存柊 { times--; if (times == 0) { cnt_time++; - if (rand() % 2 == 0 || man_up_down == 1) //正常走路随机走,上升/下降/死亡线接近时加速 + if (rand() % 2 == 0 || man_up_down == 1) //姝e父璧拌矾闅忔満璧帮紝涓婂崌/涓嬮檷/姝讳骸绾挎帴杩戞椂鍔犻 if (now_pass != 0) man_move(); times = 15000; @@ -928,39 +928,39 @@ int main() system("mode con cols=50 lines=28"); HideCursor(); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3); - printf("****** 游戏名: 俄罗斯方块Tetris Plus ******\n"); + printf("****** 娓告垙鍚嶏細 淇勭綏鏂柟鍧桾etris Plus ******\n"); printf("****** ******\n"); - printf("****** 程序作者: 404name ******\n"); + printf("****** 绋嬪簭浣滆咃細 404name ******\n"); printf("****** ******\n"); - printf("****** 操作方式: ←左移动 ******\n"); - printf("****** 操作方式: →右移动 ******\n"); - printf("****** 操作方式: ↑上旋转 ******\n"); - printf("****** 操作方式: ↓加速下降 ******\n"); - printf("****** 操作方式: 回车确认键 ******\n"); - printf("****** 建议游戏字号大小为26号 ******\n"); + printf("****** 鎿嶄綔鏂瑰紡锛 鈫愬乏绉诲姩 ******\n"); + printf("****** 鎿嶄綔鏂瑰紡锛 鈫掑彸绉诲姩 ******\n"); + printf("****** 鎿嶄綔鏂瑰紡锛 鈫戜笂鏃嬭浆 ******\n"); + printf("****** 鎿嶄綔鏂瑰紡锛 鈫撳姞閫熶笅闄 ******\n"); + printf("****** 鎿嶄綔鏂瑰紡锛 鍥炶溅纭閿 ******\n"); + printf("****** 寤鸿娓告垙瀛楀彿澶у皬涓26鍙 ******\n"); getchar(); gotoxy(0, 0); - printf("********************游戏介绍*********************\n"); + printf("********************娓告垙浠嬬粛*********************\n"); printf("****** ******\n"); - printf("****** 一共15关,解救老人即可进入下一关 ******\n"); + printf("****** 涓鍏15鍏筹紝瑙f晳鑰佷汉鍗冲彲杩涘叆涓嬩竴鍏 ******\n"); printf("****** ******\n"); - printf("****** ( 老人降落到第一层即为成功) ******\n"); + printf("****** 锛 鑰佷汉闄嶈惤鍒扮涓灞傚嵆涓烘垚鍔燂級 ******\n"); printf("****** ******\n"); - printf("****** 正常启动:按两下回车 ******\n"); - printf("****** 跳关启动:按T再回车 ******\n"); - printf("****** (选择0关对应的是无尽模式) ******\n"); - printf("********************游戏介绍*********************\n"); + printf("****** 姝e父鍚姩锛氭寜涓や笅鍥炶溅 ******\n"); + printf("****** 璺冲叧鍚姩锛氭寜T鍐嶅洖杞 ******\n"); + printf("****** (閫夋嫨0鍏冲搴旂殑鏄棤灏芥ā寮) ******\n"); + printf("********************娓告垙浠嬬粛*********************\n"); now_pass = 1; choose = getchar(); getchar(); if (choose == 'T' || choose == 't') { - printf("请输入开始关卡"); + printf("璇疯緭鍏ュ紑濮嬪叧鍗"); scanf("%d", &temp_pass); if (temp_pass > 15 || temp_pass < 0) { - temp_pass = 16; //彩蛋关卡 - printf("即将进入彩蛋关卡"); + temp_pass = 16; //褰╄泲鍏冲崱 + printf("鍗冲皢杩涘叆褰╄泲鍏冲崱"); Sleep(1000); } now_pass = temp_pass; diff --git "a/\344\277\204\347\275\227\346\226\257\346\226\271\345\235\227Plus/\347\273\217\345\205\270\347\211\210demo(600\350\241\214\345\276\205\347\274\251\345\207\217).cpp" "b/\344\277\204\347\275\227\346\226\257\346\226\271\345\235\227Plus/\347\273\217\345\205\270\347\211\210demo(600\350\241\214\345\276\205\347\274\251\345\207\217).cpp" index 8fb567a..7f0f452 100644 --- "a/\344\277\204\347\275\227\346\226\257\346\226\271\345\235\227Plus/\347\273\217\345\205\270\347\211\210demo(600\350\241\214\345\276\205\347\274\251\345\207\217).cpp" +++ "b/\344\277\204\347\275\227\346\226\257\346\226\271\345\235\227Plus/\347\273\217\345\205\270\347\211\210demo(600\350\241\214\345\276\205\347\274\251\345\207\217).cpp" @@ -1,15 +1,15 @@ -#include //用于getch() +#include //鐢ㄤ簬getch锛堬級 #include #include -#include //用于rand +#include //鐢ㄤ簬rand #include #include #include -//■□ +//鈻犫枴 /*----- -日志: -·人物移动格外算时间,有下降加快更新,上升同样,这时候不算随机数,平常走动随机数 -·win画面更新。开头介绍,胜利。下降时间控制 +鏃ュ織锛 +路浜虹墿绉诲姩鏍煎绠楁椂闂达紝鏈変笅闄嶅姞蹇洿鏂帮紝涓婂崌鍚屾牱锛岃繖鏃跺欎笉绠楅殢鏈烘暟锛屽钩甯歌蛋鍔ㄩ殢鏈烘暟 +路win鐢婚潰鏇存柊銆傚紑澶翠粙缁嶏紝鑳滃埄銆備笅闄嶆椂闂存帶鍒 @@ -19,8 +19,8 @@ int map[500][500] = {0}; int color_map[500][500] = {0}; int check_sum[500][2] = {0}; int if_full = 0; -//下标按顺序为 总分 应该下降的层数 -//逻辑顺序是谁 check_sun储存对应map层数的和,当满的时候,他向上的有值的层数就要增加相应的该降层数。 +//涓嬫爣鎸夐『搴忎负 鎬诲垎 搴旇涓嬮檷鐨勫眰鏁 +//閫昏緫椤哄簭鏄皝 check_sun鍌ㄥ瓨瀵瑰簲map灞傛暟鐨勫拰锛屽綋婊$殑鏃跺欙紝浠栧悜涓婄殑鏈夊肩殑灞傛暟灏辫澧炲姞鐩稿簲鐨勮闄嶅眰鏁般 int height, width, top; int start_x = 6, start_y = 10, tx, ty, x, y, times, cnt_time, old_index0, index0, cnt = 0; int if_change = 0, if_death = 0, reduce_time = 0; @@ -29,18 +29,18 @@ int next_position_x[2] = {1, 1}, next_position_y[2] = {10, 2}, show_next = 0, sh int now_color = 3, next_color = 2, next_next_color = 3; int death_line = 8; -char message[7][20] = { //自定义logo +char message[7][20] = { //鑷畾涔塴ogo {"[][][][][]"}, {"[Tetris ]"}, {"[ plus]"}, - {"[俄罗斯 ]"}, - {"[方块plus]"}, + {"[淇勭綏鏂 ]"}, + {"[鏂瑰潡plus]"}, {"[][][][][]"}}; struct Pass { char ss[10][11]; } pass[20] = { - {{{"0000000000"}, //1可以自己设置基础关卡 0空气 1砖块 + {{{"0000000000"}, //1鍙互鑷繁璁剧疆鍩虹鍏冲崱 0绌烘皵 1鐮栧潡 {"0000000000"}, {"0000000000"}, {"0000000000"}, @@ -48,15 +48,15 @@ struct Pass {"0000000000"}, {"0000000000"}, {"0000000000"}}}}; -int now_pass = 1; //多关卡,现在默认第一关 +int now_pass = 1; //澶氬叧鍗★紝鐜板湪榛樿绗竴鍏 -int T[30][4] = { //7种4*4状态,对应的数据是4位数对应4种情况(有效数前面不能为零不然会认为其他进制) +int T[30][4] = { //7绉4*4鐘舵侊紝瀵瑰簲鐨勬暟鎹槸4浣嶆暟瀵瑰簲4绉嶆儏鍐碉紙鏈夋晥鏁板墠闈笉鑳戒负闆朵笉鐒朵細璁や负鍏朵粬杩涘埗锛 {0000, 1011, 0000, 0000}, //T {1101, 1111, 111, 0000}, {0000, 1110, 0000, 0000}, {0000, 0000, 0000, 0000}, - {0000, 0000, 0000, 0000}, //田 + {0000, 0000, 0000, 0000}, //鐢 {0000, 1111, 1111, 0000}, {0000, 1111, 1111, 0000}, {0000, 0000, 0000, 0000}, @@ -66,22 +66,22 @@ struct Pass {101, 0000, 0000, 0000}, {101, 0000, 0000, 0000}, - {1000, 1010, 1, 0000}, //右L + {1000, 1010, 1, 0000}, //鍙矻 {101, 1111, 101, 0000}, {100, 1010, 10, 0000}, {0000, 0000, 0000, 0000}, - {0001, 1010, 10, 0000}, //左L + {0001, 1010, 10, 0000}, //宸 {101, 1111, 101, 0000}, {1000, 1010, 100, 0000}, {0000, 0000, 0000, 0000}, - {0000, 1111, 101, 0000}, //右与 + {0000, 1111, 101, 0000}, //鍙充笌 {101, 1111, 1010, 0000}, {0000, 0000, 1010, 0000}, {0000, 0000, 0000, 0000}, - {101, 1111, 0000, 0000}, //左与 + {101, 1111, 0000, 0000}, //宸︿笌 {1010, 1111, 101, 0000}, {1010, 0000, 0000, 0000}, {0000, 0000, 0000, 0000}}; @@ -91,13 +91,13 @@ int show(int out, int in, int if_auto, int class0); void init_brick(); void death_line_drop(int turn); void check(); -void HideCursor() //光标隐藏 +void HideCursor() //鍏夋爣闅愯棌 { - CONSOLE_CURSOR_INFO cursor_info = {1, 0}; //后边的0代表光标不可见 + CONSOLE_CURSOR_INFO cursor_info = {1, 0}; //鍚庤竟鐨0浠h〃鍏夋爣涓嶅彲瑙 SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info); } -void gotoxy(int x, int y) //坐标函数 +void gotoxy(int x, int y) //鍧愭爣鍑芥暟 { HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); COORD pos; @@ -120,10 +120,10 @@ void init_brick() next_turn = next_next_turn; next_next_turn = rand() % 7; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), next_color); - show_next = 1; //打印下下个 + show_next = 1; //鎵撳嵃涓嬩笅涓 show(1, 1, 1, 1); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), next_next_color); - show_next = 2; //打印下个 + show_next = 2; //鎵撳嵃涓嬩釜 show(1, 1, 1, 1); show_next = 0; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), now_color); @@ -134,7 +134,7 @@ void init_brick() void init(int pass0) { - HideCursor(); //隐藏光标 + HideCursor(); //闅愯棌鍏夋爣 int i, j; system("cls"); times = 500; @@ -146,7 +146,7 @@ void init(int pass0) death_line = 8; height = 26; width = 23; - //游戏开始样式 + //娓告垙寮濮嬫牱寮 for (i = 0; i <= height; i++) { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), rand() % 8 + 1); @@ -154,9 +154,9 @@ void init(int pass0) { gotoxy(j, i); if (i == 0 || i == height || j == 0 || j == width - 1) - printf("■"); + printf("鈻"); else - printf("□"); + printf("鈻"); } } gotoxy(6, height / 2 - 2); @@ -164,9 +164,9 @@ void init(int pass0) gotoxy(6, height / 2); printf("[Start game]"); getchar(); - //点击开始 + //鐐瑰嚮寮濮 gotoxy(0, 0); - //构建地图 + //鏋勫缓鍦板浘 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3); for (i = 0; i <= height; i++) { @@ -191,14 +191,14 @@ void init(int pass0) { printf("[]"); } - //这里是从17行开始打印8行关卡。 + //杩欓噷鏄粠17琛屽紑濮嬫墦鍗8琛屽叧鍗° else if (i >= (height - 8) && pass[pass0 - 1].ss[i - (height - 8)][j / 2 - 1] != '0' && pass0 != 0) { if (pass[pass0 - 1].ss[i - (height - 8)][j / 2 - 1] == '1') { map[i][j] = 2; check_sum[i][0] += 2; - printf("■"); + printf("鈻"); } else printf(" "); @@ -243,9 +243,9 @@ void init(int pass0) getch(); } -void death_line_drop(int turn) //0对应打印 1对应下降 +void death_line_drop(int turn) //0瀵瑰簲鎵撳嵃 1瀵瑰簲涓嬮檷 { - //清空死亡线 + //娓呯┖姝讳骸绾 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3); gotoxy(0, death_line); printf("[]"); @@ -257,9 +257,9 @@ void init(int pass0) if (map[death_line][i] != 1) printf(" "); } - if (turn == 1) //是否下降 + if (turn == 1) //鏄惁涓嬮檷 death_line++; - //打印新的死亡线 + //鎵撳嵃鏂扮殑姝讳骸绾 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 4); gotoxy(0, death_line); printf("{}"); @@ -282,7 +282,7 @@ void init(int pass0) void delete_line() { - HideCursor(); //隐藏光标 + HideCursor(); //闅愯棌鍏夋爣 int i, j, temp = 0; for (i = height - 1; i >= death_line; i--) { @@ -296,7 +296,7 @@ void delete_line() } } } - //下降 + //涓嬮檷 for (i = height - 1; i >= death_line; i--) { if (check_sum[i][1]) @@ -307,7 +307,7 @@ void delete_line() for (j = 2; j <= width - 2; j = j + 2) { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color_map[i][j]); - map[i][j] == 2 ? printf("■") : printf(" "); + map[i][j] == 2 ? printf("鈻") : printf(" "); map[i + check_sum[i][1]][j] = map[i][j]; } gotoxy(2, i); @@ -321,7 +321,7 @@ void delete_line() } check(); Sleep(50); - //刷新死亡线 + //鍒锋柊姝讳骸绾 death_line_drop(0); } @@ -339,7 +339,7 @@ int get_index0_num(int res, int index0) return ans; } -int show(int out, int in, int if_auto, int class0) //是否清除 是否加载 是否自动下落 赋值类型(1在移动 2定位的) +int show(int out, int in, int if_auto, int class0) //鏄惁娓呴櫎 鏄惁鍔犺浇 鏄惁鑷姩涓嬭惤 璧嬪肩被鍨嬶紙1鍦ㄧЩ鍔 2瀹氫綅鐨勶級 { int i, j; int temp_x; @@ -359,7 +359,7 @@ int get_index0_num(int res, int index0) now_turn = (show_next == 2 ? next_next_turn : next_turn); tx = x, ty = y; } - if (out == 1) //清除 + if (out == 1) //娓呴櫎 { for (i = tx; i < tx + 4; i++) { @@ -382,9 +382,9 @@ int get_index0_num(int res, int index0) } } } - if (in == 1) //打印 + if (in == 1) //鎵撳嵃 { - int now_turn_index = now_turn * 4; //对应到的初始下标 + int now_turn_index = now_turn * 4; //瀵瑰簲鍒扮殑鍒濆涓嬫爣 for (i = x; i < x + 4; i++) { for (j = y; j < y + 4; j++) @@ -404,9 +404,9 @@ int get_index0_num(int res, int index0) color_map[i][2 * j - y] = now_color; } if (!(class0 == 2 && i <= death_line)) - printf("■"); + printf("鈻"); } - else if (i <= height && 2 * j - y <= width && get_index0_num(T[i - x + now_turn_index][j - y], index0) == 1 && map[i][2 * j - y] == 2 && if_auto == 1) //失败则回退 + else if (i <= height && 2 * j - y <= width && get_index0_num(T[i - x + now_turn_index][j - y], index0) == 1 && map[i][2 * j - y] == 2 && if_auto == 1) //澶辫触鍒欏洖閫 { if (show_first) { @@ -420,7 +420,7 @@ int get_index0_num(int res, int index0) show(1, 1, 1, 1); return 0; } - else if (i <= height && 2 * j - y <= width && get_index0_num(T[i - x + now_turn_index][j - y], index0) == 1 && map[i][2 * j - y] == 2) //失败则回退 + else if (i <= height && 2 * j - y <= width && get_index0_num(T[i - x + now_turn_index][j - y], index0) == 1 && map[i][2 * j - y] == 2) //澶辫触鍒欏洖閫 { int ttx = tx; int tty = ty; @@ -460,7 +460,7 @@ int get_index0_num(int res, int index0) return 1; } -void check() //统计每层的得分情况 +void check() //缁熻姣忓眰鐨勫緱鍒嗘儏鍐 { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3); for (int i = 6; i < height; i++) @@ -472,7 +472,7 @@ int get_index0_num(int res, int index0) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), now_color); } -void manchange() //人为输入更新 +void manchange() //浜轰负杈撳叆鏇存柊 { char ch, ch1, ch2; if (kbhit()) @@ -481,7 +481,7 @@ int get_index0_num(int res, int index0) if (ch != ' ' && ch != 'w' && ch != 's' && ch != 'a' && ch != 'd' && ch != -32 && ch != 'p' && ch != 'b') return; if (ch == -32) - { //同时启用wasd 和上下左右键 + { //鍚屾椂鍚敤wasd 鍜屼笂涓嬪乏鍙抽敭 ch1 = getch(); switch (ch1) { @@ -527,9 +527,9 @@ int get_index0_num(int res, int index0) } } } -void autochange() //自动更新 +void autochange() //鑷姩鏇存柊 { - times--; //模拟sleep函数 + times--; //妯℃嫙sleep鍑芥暟 if (times == 0) { cnt_time++; @@ -548,7 +548,7 @@ int get_index0_num(int res, int index0) if (cnt_time == 20 && now_pass != 0) { cnt_time = 0; - //是否开启死亡线下降: 0否 1是 + //鏄惁寮鍚浜$嚎涓嬮檷锛 0鍚 1鏄 death_line_drop(0); } } @@ -559,16 +559,16 @@ int main() system("mode con cols=50 lines=28"); HideCursor(); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3); - printf("****** 游戏名: 俄罗斯方块Tetris Plus ******\n"); + printf("****** 娓告垙鍚嶏細 淇勭綏鏂柟鍧桾etris Plus ******\n"); printf("****** ******\n"); - printf("****** 程序作者: 404name ******\n"); + printf("****** 绋嬪簭浣滆咃細 404name ******\n"); printf("****** ******\n"); - printf("****** 操作方式: ←左移动 ******\n"); - printf("****** 操作方式: →右移动 ******\n"); - printf("****** 操作方式: ↑上旋转 ******\n"); - printf("****** 操作方式: ↓加速下降 ******\n"); - printf("****** 操作方式: 回车确认键 ******\n"); - printf("****** 建议游戏字号大小为26号 ******\n"); + printf("****** 鎿嶄綔鏂瑰紡锛 鈫愬乏绉诲姩 ******\n"); + printf("****** 鎿嶄綔鏂瑰紡锛 鈫掑彸绉诲姩 ******\n"); + printf("****** 鎿嶄綔鏂瑰紡锛 鈫戜笂鏃嬭浆 ******\n"); + printf("****** 鎿嶄綔鏂瑰紡锛 鈫撳姞閫熶笅闄 ******\n"); + printf("****** 鎿嶄綔鏂瑰紡锛 鍥炶溅纭閿 ******\n"); + printf("****** 寤鸿娓告垙瀛楀彿澶у皬涓26鍙 ******\n"); getchar(); gotoxy(0, 0); system("mode con cols=28 lines=28"); diff --git "a/\344\277\204\347\275\227\346\226\257\346\226\271\345\235\227Plus/\347\273\217\345\205\270\347\211\210demo(600\350\241\214\345\276\205\347\274\251\345\207\217).exe" "b/\344\277\204\347\275\227\346\226\257\346\226\271\345\235\227Plus/\347\273\217\345\205\270\347\211\210demo(600\350\241\214\345\276\205\347\274\251\345\207\217).exe" new file mode 100644 index 0000000..731a2ed Binary files /dev/null and "b/\344\277\204\347\275\227\346\226\257\346\226\271\345\235\227Plus/\347\273\217\345\205\270\347\211\210demo(600\350\241\214\345\276\205\347\274\251\345\207\217).exe" differ diff --git "a/\345\223\224\345\223\251\345\223\224\345\223\251\347\247\273\345\212\250\347\253\257/BilibiliDemo.cpp" "b/\345\223\224\345\223\251\345\223\224\345\223\251\347\247\273\345\212\250\347\253\257/BilibiliDemo.cpp" index 7c81cdc..461d5d0 100644 --- "a/\345\223\224\345\223\251\345\223\224\345\223\251\347\247\273\345\212\250\347\253\257/BilibiliDemo.cpp" +++ "b/\345\223\224\345\223\251\345\223\224\345\223\251\347\247\273\345\212\250\347\253\257/BilibiliDemo.cpp" @@ -1,64 +1,64 @@ /*----------------------------------- -程序 : 字符画开发小框架 -作者 : 404name / 绝伦N -完成时间: 2021.1.11 -说明:这个程序不太好表达,后面考虑出一期教程,但他的功能十分强大, - 就你不仅仅可以改写哔哩哔哩,其他软件你也只要写好组件然后用页面去调用就能显示。 - 个人改造可以只要 - 数组介绍: - 贯穿全代码的是一个index 的概念,就是第n个组件。 - appMap负责存组件 取值就是一个index,用这个下标去appMapMessage里面拿这个组件的具体信息,位置 - 最后去appMapIron里面用index去取这个组件的字符画内容,有些是不能写死的就要格外设定需要函数去打印 +绋嬪簭 锛 瀛楃鐢诲紑鍙戝皬妗嗘灦 +浣滆 锛 404name / 缁濅鸡N +瀹屾垚鏃堕棿锛 2021.1.11 +璇存槑锛氳繖涓▼搴忎笉澶ソ琛ㄨ揪锛屽悗闈㈣冭檻鍑轰竴鏈熸暀绋嬶紝浣嗕粬鐨勫姛鑳藉崄鍒嗗己澶э紝 + 灏变綘涓嶄粎浠呭彲浠ユ敼鍐欏摂鍝╁摂鍝╋紝鍏朵粬杞欢浣犱篃鍙鍐欏ソ缁勪欢鐒跺悗鐢ㄩ〉闈㈠幓璋冪敤灏辫兘鏄剧ず銆 + 涓汉鏀归犲彲浠ュ彧瑕 + 鏁扮粍浠嬬粛锛 + 璐┛鍏ㄤ唬鐮佺殑鏄竴涓猧ndex 鐨勬蹇碉紝灏辨槸绗琻涓粍浠躲 + appMap璐熻矗瀛樼粍浠 鍙栧煎氨鏄竴涓猧ndex锛岀敤杩欎釜涓嬫爣鍘籥ppMapMessage閲岄潰鎷胯繖涓粍浠剁殑鍏蜂綋淇℃伅锛屼綅缃 + 鏈鍚庡幓appMapIron閲岄潰鐢╥ndex鍘诲彇杩欎釜缁勪欢鐨勫瓧绗︾敾鍐呭锛屾湁浜涙槸涓嶈兘鍐欐鐨勫氨瑕佹牸澶栬瀹氶渶瑕佸嚱鏁板幓鎵撳嵃 - appMap[20][12][7] : 存界面,表示有20个12*7的界面 这里设计很特别,需要格外说明 - 可以先不懂动 - appMapMessage[100][5] 就是取到对应的内容的具体信息 - appMapIcon[100][1000]:存界面 + appMap[20][12][7] : 瀛樼晫闈紝琛ㄧず鏈20涓12*7鐨勭晫闈 杩欓噷璁捐寰堢壒鍒紝闇瑕佹牸澶栬鏄 + 鍙互鍏堜笉鎳傚姩 + appMapMessage[100][5] 灏辨槸鍙栧埌瀵瑰簲鐨勫唴瀹圭殑鍏蜂綋淇℃伅 + appMapIcon[100][1000]锛氬瓨鐣岄潰 - 主要函数介绍 - printDemo(index,bool); html网页里面的鼠标移动到他上面和移开的概念,该函数会绘制两种状态。 - checkAction 就类似监听器,所以路由跳转全到那边设置 - move函数就是移动 + 涓昏鍑芥暟浠嬬粛 + printDemo(index,bool); html缃戦〉閲岄潰鐨勯紶鏍囩Щ鍔ㄥ埌浠栦笂闈㈠拰绉诲紑鐨勬蹇碉紝璇ュ嚱鏁颁細缁樺埗涓ょ鐘舵併 + checkAction 灏辩被浼肩洃鍚櫒锛屾墍浠ヨ矾鐢辫烦杞叏鍒伴偅杈硅缃 + move鍑芥暟灏辨槸绉诲姩 -----------------------------------*/ #include //getch() #include #include -#define Is_Active_Color 115 //当前所在状态栏的颜色 浅蓝色灰底 -#define Is_Selected1_Color 128 //被选中的颜色1 蓝色深灰底 -#define Is_Selected2_Color 62 //被选中的颜色2 白色蓝底 +#define Is_Active_Color 115 //褰撳墠鎵鍦ㄧ姸鎬佹爮鐨勯鑹 娴呰摑鑹茬伆搴 +#define Is_Selected1_Color 128 //琚変腑鐨勯鑹1 钃濊壊娣辩伆搴 +#define Is_Selected2_Color 62 //琚変腑鐨勯鑹2 鐧借壊钃濆簳 #define Is_Selected3_Color \ - 369 //被选中的颜色3 深蓝色灰色(解决一些字符不显示背景用) -#define Video_Color 3 //视频颜色 蓝色黑底 -#define Normal_Color 112 //正常的颜色 灰底 -#define Boder_Color 391 //边框的颜色 深灰底 -const int WIDTH = 53; //单位宽度 -const int HEIGHT = 47; //单位高度 -const int L = 4; //用户头像长宽 -const int LL = 20; //视频封面长度 -const int N = 50; //标题、用户名等最长长度 -const int M = 1000000; //视频收藏,发布,粉丝等上限 -/*appMap是内容映射,取到内容数值对应下面的具体信息 -0边界 1:头像(点击登录) 2搜索框 3信息 -4 5 6 7 8 直播/推荐/热门/追番/影视 -9-14 6个视频块 -15-19 首页/推荐/动态/会员购/我的 -20 404页面 */ -/*全局变量 -nowPage 0 1 2 3 404页面/首页/热搜/我的/搜索页面/待更新 + 369 //琚変腑鐨勯鑹3 娣辫摑鑹茬伆鑹(瑙e喅涓浜涘瓧绗︿笉鏄剧ず鑳屾櫙鐢) +#define Video_Color 3 //瑙嗛棰滆壊 钃濊壊榛戝簳 +#define Normal_Color 112 //姝e父鐨勯鑹 鐏板簳 +#define Boder_Color 391 //杈规鐨勯鑹 娣辩伆搴 +const int WIDTH = 53; //鍗曚綅瀹藉害 +const int HEIGHT = 47; //鍗曚綅楂樺害 +const int L = 4; //鐢ㄦ埛澶村儚闀垮 +const int LL = 20; //瑙嗛灏侀潰闀垮害 +const int N = 50; //鏍囬銆佺敤鎴峰悕绛夋渶闀块暱搴 +const int M = 1000000; //瑙嗛鏀惰棌锛屽彂甯冿紝绮変笣绛変笂闄 +/*appMap鏄唴瀹规槧灏勶紝鍙栧埌鍐呭鏁板煎搴斾笅闈㈢殑鍏蜂綋淇℃伅 +0杈圭晫 1锛氬ご鍍(鐐瑰嚮鐧诲綍) 2鎼滅储妗 3淇℃伅 +4 5 6 7 8 鐩存挱/鎺ㄨ崘/鐑棬/杩界暘/褰辫 +9-14 6涓棰戝潡 +15-19 棣栭〉/鎺ㄨ崘/鍔ㄦ/浼氬憳璐/鎴戠殑 +20 404椤甸潰 */ +/*鍏ㄥ眬鍙橀噺 +nowPage 0 1 2 3 404椤甸潰/棣栭〉/鐑悳/鎴戠殑/鎼滅储椤甸潰/寰呮洿鏂 */ int nowPage = 1; -bool onPlay = false; //关闭则是杀死 -bool stopPlay = true; //开启则是停止 -int activeIndexBottom = 15; //当前响应的页面(顶部 -int activeIndexTop = 5; //当前响应的页面(底部 -char bacground[48][55] = { +bool onPlay = false; //鍏抽棴鍒欐槸鏉姝 +bool stopPlay = true; //寮鍚垯鏄仠姝 +int activeIndexBottom = 15; //褰撳墠鍝嶅簲鐨勯〉闈(椤堕儴 +int activeIndexTop = 5; //褰撳墠鍝嶅簲鐨勯〉闈(搴曢儴 +char bacground[48][56] = { " ", " ", - " 你 感 兴 趣 的 视 频 ", + " 浣 鎰 鍏 瓒 鐨 瑙 棰 ", " ", - " 都 在 B 站 ", + " 閮 鍦 B 绔 ", " r. ", " vPvi ", " Qq ", @@ -102,14 +102,14 @@ char bacground[48][55] = { " |____/|_|_|_|_.__/|_|_|_| ", " ", }; -//三维依次是 哪个界面 界面哪行 某行第几个模块 -// appMap[x][0][0]表示该页面有几行 -int appMap[20][12][7] = {{{5, 0, 0, 0, 0, 0, 0}, // 0.404报错页面 +//涓夌淮渚濇鏄 鍝釜鐣岄潰 鐣岄潰鍝 鏌愯绗嚑涓ā鍧 +// appMap[x][0][0]琛ㄧず璇ラ〉闈㈡湁鍑犺 +int appMap[20][12][7] = {{{5, 0, 0, 0, 0, 0, 0}, // 0.404鎶ラ敊椤甸潰 {0, 1, 2, 2, 2, 3, 0}, {0, 20, 20, 20, 20, 20, 0}, {0, 15, 16, 17, 18, 19, 0}, {0, 0, 0, 0, 0, 0, 0}}, - {{8, 0, 0, 0, 0, 0, 0}, // 1.首页 + {{8, 0, 0, 0, 0, 0, 0}, // 1.棣栭〉 {0, 1, 2, 2, 2, 3, 0}, {0, 4, 5, 6, 7, 8, 0}, {0, 9, 9, 10, 10, 10, 0}, @@ -117,7 +117,7 @@ char bacground[48][55] = { {0, 13, 13, 14, 14, 14, 0}, {0, 15, 16, 17, 18, 19, 0}, {0, 0, 0, 0, 0, 0, 0}}, - {{10, 0, 0, 0, 0, 0, 0}, // 2.热门 (待更新 ) + {{10, 0, 0, 0, 0, 0, 0}, // 2.鐑棬 (寰呮洿鏂 ) {0, 1, 2, 2, 2, 3, 0}, {0, 4, 5, 6, 7, 8, 0}, {0, 25, 25, 26, 27, 28, 0}, @@ -127,7 +127,7 @@ char bacground[48][55] = { {0, 24, 24, 24, 24, 24, 0}, {0, 15, 16, 17, 18, 19, 0}, {0, 0, 0, 0, 0, 0, 0}}, - {{8, 0, 0, 0, 0, 0, 0}, // 3.我的(待更新 ) + {{8, 0, 0, 0, 0, 0, 0}, // 3.鎴戠殑(寰呮洿鏂 ) {0, 1, 2, 2, 2, 3, 0}, {0, 4, 5, 6, 7, 8, 0}, {0, 9, 9, 10, 10, 10, 0}, @@ -135,7 +135,7 @@ char bacground[48][55] = { {0, 13, 13, 14, 14, 14, 0}, {0, 15, 16, 17, 18, 19, 0}, {0, 0, 0, 0, 0, 0, 0}}, - {{9, 0, 0, 0, 0, 0, 0}, // 4.视频详细页(简介) + {{9, 0, 0, 0, 0, 0, 0}, // 4.瑙嗛璇︾粏椤(绠浠) {0, 29, 29, 29, 29, 29, 0}, {0, 30, 31, 32, 32, 33, 0}, {0, 34, 34, 34, 34, 35, 0}, @@ -144,7 +144,7 @@ char bacground[48][55] = { {0, 42, 42, 42, 42, 42, 0}, {0, 43, 43, 43, 43, 43, 0}, {0, 0, 0, 0, 0, 0, 0}}, - {{8, 0, 0, 0, 0, 0, 0}, // 5.消息页面 (待更新 ) + {{8, 0, 0, 0, 0, 0, 0}, // 5.娑堟伅椤甸潰 (寰呮洿鏂 ) {0, 1, 2, 2, 2, 3, 0}, {0, 25, 25, 26, 27, 28, 0}, {0, 21, 21, 21, 21, 21, 0}, @@ -152,237 +152,237 @@ char bacground[48][55] = { {0, 23, 23, 23, 23, 23, 0}, {0, 24, 24, 24, 24, 24, 0}, {0, 0, 0, 0, 0, 0, 0}}}; -/*appMap取到的内容对应下面的下标, -信息依次是映射到实际打印处的 x/y/高/宽/类别 -类别: 0 无功能项 点击进不去 - 1 有功能项 点击进入action - 2 待开发 +/*appMap鍙栧埌鐨勫唴瀹瑰搴斾笅闈㈢殑涓嬫爣锛 +淇℃伅渚濇鏄槧灏勫埌瀹為檯鎵撳嵃澶勭殑 x/y/楂/瀹/绫诲埆 +绫诲埆锛 0 鏃犲姛鑳介」 鐐瑰嚮杩涗笉鍘 + 1 鏈夊姛鑳介」 鐐瑰嚮杩涘叆action + 2 寰呭紑鍙 */ int appMapMessage[100][5] = { {0, 0, 0, 0, 0}, - {1, 2, 2, 6, 1}, // 1-3 顶部信息栏 头像/搜索框/信息 + {1, 2, 2, 6, 1}, // 1-3 椤堕儴淇℃伅鏍 澶村儚/鎼滅储妗/淇℃伅 {1, 12, 2, 31, 1}, {1, 43, 2, 8, 1}, - {4, 2, 1, 9, 1}, // 4-8 顶部标签功能栏 - {4, 12, 1, 9, 1}, //推荐 - {4, 22, 1, 9, 1}, //热门 + {4, 2, 1, 9, 1}, // 4-8 椤堕儴鏍囩鍔熻兘鏍 + {4, 12, 1, 9, 1}, //鎺ㄨ崘 + {4, 22, 1, 9, 1}, //鐑棬 {4, 32, 1, 9, 1}, // {4, 42, 1, 9, 1}, - {6, 1, 11, 25, 1}, // 9-14 6个视频点位 + {6, 1, 11, 25, 1}, // 9-14 6涓棰戠偣浣 {6, 27, 11, 25, 1}, {18, 1, 11, 25, 1}, {18, 27, 11, 25, 1}, {30, 1, 11, 25, 1}, {30, 27, 11, 25, 1}, - {42, 2, 4, 9, 1}, // 15-19 底部标签功能栏 + {42, 2, 4, 9, 1}, // 15-19 搴曢儴鏍囩鍔熻兘鏍 {42, 12, 4, 9, 1}, {42, 22, 4, 9, 1}, {42, 32, 4, 9, 1}, {42, 42, 4, 9, 1}, - {6, 2, 35, 49, 0}, // 20.404页面 - {10, 2, 7, 49, 1}, // 21-24. top热门榜页面 + {6, 2, 35, 49, 0}, // 20.404椤甸潰 + {10, 2, 7, 49, 1}, // 21-24. top鐑棬姒滈〉闈 {18, 2, 7, 49, 1}, {26, 2, 7, 49, 1}, {34, 2, 7, 49, 1}, - {6, 4, 4, 10, 1}, // 25-28 中间4格栏,热门 信息共用 + {6, 4, 4, 10, 1}, // 25-28 涓棿4鏍兼爮锛岀儹闂 淇℃伅鍏辩敤 {6, 16, 4, 10, 1}, {6, 27, 4, 10, 1}, {6, 39, 4, 10, 1}, - {1, 1, 14, 51, 1}, // 29 视频模块 - {15, 7, 1, 4, 1}, // 30-33 视频下方功能 简介/评论/点我发弹幕/弹幕开关 + {1, 1, 14, 51, 1}, // 29 瑙嗛妯″潡 + {15, 7, 1, 4, 1}, // 30-33 瑙嗛涓嬫柟鍔熻兘 绠浠/璇勮/鐐规垜鍙戝脊骞/寮瑰箷寮鍏 {15, 18, 1, 10, 1}, {15, 32, 1, 15, 1}, {15, 47, 1, 2, 1}, - {17, 1, 2, 40, 1}, // 34-36 视频下方消息栏 个人页/关注/视频标题+简介 + {17, 1, 2, 40, 1}, // 34-36 瑙嗛涓嬫柟娑堟伅鏍 涓汉椤/鍏虫敞/瑙嗛鏍囬+绠浠 {17, 44, 2, 8, 1}, {20, 1, 5, 51, 1}, - {26, 2, 4, 9, 1}, // 37-41 点赞/不喜欢/投币/收藏/转发 + {26, 2, 4, 9, 1}, // 37-41 鐐硅禐/涓嶅枩娆/鎶曞竵/鏀惰棌/杞彂 {26, 12, 4, 9, 1}, {26, 22, 4, 9, 1}, {26, 32, 4, 9, 1}, {26, 42, 4, 9, 1}, {31, 2, 7, 49, 1}, - {39, 2, 7, 49, 1}, // 42-45 个人页面4个视频模块 和推荐公用 + {39, 2, 7, 49, 1}, // 42-45 涓汉椤甸潰4涓棰戞ā鍧 鍜屾帹鑽愬叕鐢 {31, 2, 7, 49, 1}, - {39, 2, 7, 49, 1}, // 43-45视频下方广告 + 推荐视频 + {39, 2, 7, 49, 1}, // 43-45瑙嗛涓嬫柟骞垮憡 + 鎺ㄨ崘瑙嗛 }; char appMapIcon[100][1000] = { " ", - "[我是][头像]", // 1-5 + "[鎴戞槸][澶村儚]", // 1-5 "|o ######################### || \\ |", - "〖信息〗 ", - "〖直播〗 ", - "〖推荐〗 ", - "〖热门〗 ", // 6-10 - "〖追番〗 ", - "〖影视〗 ", + "銆栦俊鎭 ", + "銆栫洿鎾 ", + "銆栨帹鑽愩 ", + "銆栫儹闂ㄣ ", // 6-10 + "銆栬拷鐣 ", + "銆栧奖瑙嗐 ", ".=======================." "| |" "| |" - "| 暂无封面 |" + "| 鏆傛棤灏侀潰 |" "| |" "| |" "|__________________x:xx_|" - "|肥肠抱歉,你要找的视频 |" - "|不见了 |" - "|Up:xxxxxx Ξ |" + "|鑲ヨ偁鎶辨瓑锛屼綘瑕佹壘鐨勮棰 |" + "|涓嶈浜 |" + "|Up锛歺xxxxx 螢 |" ".=======================.", ".=======================." "| |" "| |" - "| 暂无封面 |" + "| 鏆傛棤灏侀潰 |" "| |" "| |" "|__________________x:xx_|" - "|肥肠抱歉,你要找的视频 |" - "|不见了 |" - "|Up:xxxxxx Ξ |" + "|鑲ヨ偁鎶辨瓑锛屼綘瑕佹壘鐨勮棰 |" + "|涓嶈浜 |" + "|Up锛歺xxxxx 螢 |" ".=======================.", ".=======================." "| |" "| |" - "| 暂无封面 |" + "| 鏆傛棤灏侀潰 |" "| |" "| |" "|__________________x:xx_|" - "|肥肠抱歉,你要找的视频 |" - "|不见了 |" - "|Up:xxxxxx Ξ |" + "|鑲ヨ偁鎶辨瓑锛屼綘瑕佹壘鐨勮棰 |" + "|涓嶈浜 |" + "|Up锛歺xxxxx 螢 |" ".=======================.", // 11-15 ".=======================." "| |" "| |" - "| 暂无封面 |" + "| 鏆傛棤灏侀潰 |" "| |" "| |" "|__________________x:xx_|" - "|肥肠抱歉,你要找的视频 |" - "|不见了 |" - "|Up:xxxxxx Ξ |" + "|鑲ヨ偁鎶辨瓑锛屼綘瑕佹壘鐨勮棰 |" + "|涓嶈浜 |" + "|Up锛歺xxxxx 螢 |" ".=======================.", ".=======================." "| |" "| |" - "| 暂无封面 |" + "| 鏆傛棤灏侀潰 |" "| |" "| |" "|__________________x:xx_|" - "|肥肠抱歉,你要找的视频 |" - "|不见了 |" - "|Up:xxxxxx Ξ |" + "|鑲ヨ偁鎶辨瓑锛屼綘瑕佹壘鐨勮棰 |" + "|涓嶈浜 |" + "|Up锛歺xxxxx 螢 |" ".=======================.", ".=======================." "| |" "| |" - "| 暂无封面 |" + "| 鏆傛棤灏侀潰 |" "| |" "| |" "|__________________x:xx_|" - "|肥肠抱歉,你要找的视频 |" - "|不见了 |" - "|Up:xxxxxx Ξ |" + "|鑲ヨ偁鎶辨瓑锛屼綘瑕佹壘鐨勮棰 |" + "|涓嶈浜 |" + "|Up锛歺xxxxx 螢 |" ".=======================.", - " /-\\ │ │ └―┘ 首页 ", - " O O O | 频道 ", // 16-20 - " ↗ ↖┼↘ ↙ | 动态 ", - " ︵ ╔─╗ ┗─┛ | 会员购 ", - " \\ / ╔―╗ ┗―┛ | 我的 ", + " /-\\ 鈹 鈹 鈹斺曗敇 棣栭〉 ", + " O O O | 棰戦亾 ", // 16-20 + " 鈫 鈫栤敿鈫 鈫 | 鍔ㄦ ", + " 锔 鈺斺攢鈺 鈹椻攢鈹 | 浼氬憳璐 ", + " \\ / 鈺斺曗晽 鈹椻曗敍 | 鎴戠殑 ", " ", "#################################################" - "# #《原神》角色展示- [甘 #" - "# #雨:梦里韶光] #" - "# #[5万点赞] #" - "# #[up] 原神 #" - "# #[▲] 65.6 观看 :#" + "# #銆婂師绁炪嬭鑹插睍绀- [鐢 #" + "# #闆細姊﹂噷闊跺厜] #" + "# #[5涓囩偣璧瀅 #" + "# #[up] 鍘熺 #" + "# #[鈻瞉 65.6 瑙傜湅 :#" "#__________________2:06_#########################", // 21-25 "#################################################" - "# #实在是妙! 2020年度百大 #" - "# #UP主获奖感言第一弹... #" - "# #[5万点赞] #" - "# #[up] 哔哩哔哩UP主执事 #" - "# #[▲] 54 观看 :#" + "# #瀹炲湪鏄! 2020骞村害鐧惧ぇ #" + "# #UP涓昏幏濂栨劅瑷绗竴寮... #" + "# #[5涓囩偣璧瀅 #" + "# #[up] 鍝斿摡鍝斿摡UP涓绘墽浜 #" + "# #[鈻瞉 54 瑙傜湅 :#" "#__________________8:29_#########################", "#################################################" - "# #这也叫少女 !戏里戏外 #" - "# #大搞双标!硬核吐槽《... #" + "# #杩欎篃鍙皯濂 !鎴忛噷鎴忓 #" + "# #澶ф悶鍙屾爣!纭牳鍚愭Ы銆... #" "# # #" - "# #[up] 开心嘴炮 #" - "# #[▲] 41.1 观看 :#" + "# #[up] 寮蹇冨槾鐐 #" + "# #[鈻瞉 41.1 瑙傜湅 :#" "#__________________9:11_#########################", "#################################################" - "# #最牛气女学员扣1965分, #" - "# #科三考试全程横冲直撞.. #" + "# #鏈鐗涙皵濂冲鍛樻墸1965鍒嗭紝 #" + "# #绉戜笁鑰冭瘯鍏ㄧ▼妯啿鐩存挒.. #" "# # #" - "# #[up] 老实的刘教练说车 #" - "# #[▲] 87.8 观看 :#" + "# #[up] 鑰佸疄鐨勫垬鏁欑粌璇磋溅 #" + "# #[鈻瞉 87.8 瑙傜湅 :#" "#__________________1:13_#########################", - " ■ ■■ ■■■ 排行榜 ", - " \\︵/ (☆) ︶ 入站必刷 ", // 26-30 - " +------+ |:: 三| +------+ 每周必看 ", - " 、 , ╔―╗╗ ┗―┛┛ 年度动画 ", + " 鈻 鈻犫枲 鈻犫枲鈻 鎺掕姒 ", + " \\锔/ (鈽) 锔 鍏ョ珯蹇呭埛 ", // 26-30 + " +------+ |:: 涓墊 +------+ 姣忓懆蹇呯湅 ", + " 銆 锛 鈺斺曗晽鈺 鈹椻曗敍鈹 骞村害鍔ㄧ敾 ", " ", - "简介", - "评论00000", // 31-35 - "( 点我发弹幕 |", - "√ )", //× - " [我是] 绝伦N [头像] xxxx粉丝 " + "绠浠", + "璇勮00000", // 31-35 + "( 鐐规垜鍙戝脊骞 |", + "鈭 )", //脳 + " [鎴戞槸] 缁濅鸡N [澶村儚] xxxx绮変笣 " " ", - "┌----┐└+关注 ", - " 【标题填充】 bad apple原版高清1440*1080 ^ " + "鈹----鈹愨敂+鍏虫敞 ", + " 銆愭爣棰樺~鍏呫 bad apple鍘熺増楂樻竻1440*1080 ^ " " ----------------------------------------- " - " {▲}[25.5万] {三}[2321] 1-12 BV1Wx411c7JT " - " Θ未经作者授权禁止转载 " + " {鈻瞹[25.5涓嘳 {涓墋[2321] 1-12 BV1Wx411c7JT " + " 螛鏈粡浣滆呮巿鏉冪姝㈣浆杞 " " ------------------------------------------------- ", // 36-40 - " ┓ ┏┫┻┓ ┗┻━┛ 点赞 ", - " ┏┏━┓ ┗┣┳┛ ┛ 不喜欢 ", - " ︵ (币) ︶ 投币 ", - " ☆ ☆☆☆ ☆☆ 收藏 ", - " _◣ (/◤ 分享 ", // 41-45 + " 鈹 鈹忊敨鈹烩敁 鈹椻敾鈹佲敍 鐐硅禐 ", + " 鈹忊攺鈹佲敁 鈹椻敚鈹斥敍 鈹 涓嶅枩娆 ", + " 锔 (甯) 锔 鎶曞竵 ", + " 鈽 鈽嗏槅鈽 鈽嗏槅 鏀惰棌 ", + " _鈼 (/鈼 鍒嗕韩 ", // 41-45 " ", " ", "#################################################" - "# #正确护肤,纵享水润滑肌 #" + "# #姝g‘鎶よ偆锛岀旱浜按娑︽粦鑲 #" "# # #" "# # #" "# #[up] #" - "# #[▲] 87.8 观看 :#" + "# #[鈻瞉 87.8 瑙傜湅 :#" "#################################################", "#################################################" - "# #(東京嗆種Tokyo Ghoul) #" - "# #Unravel-郑晟河-指弹.. #" + "# #(鏉变含鍡嗙óTokyo Ghoul) #" + "# #Unravel-閮戞櫉娌-鎸囧脊.. #" "# # #" - "# #[up] 郑晟河 #" - "# #[▲] 87.8 观看 :#" + "# #[up] 閮戞櫉娌 #" + "# #[鈻瞉 87.8 瑙傜湅 :#" "###################4:26##########################", " ", // 46-50 " ", " ", " ", "#################################################" - "# [我是] 绝伦N lv6 UP #" - "# [头像] #" - "# 肥肠抱歉,暂时没有评论 #" + "# [鎴戞槸] 缁濅鸡N lv6 UP #" + "# [澶村儚] #" + "# 鑲ヨ偁鎶辨瓑锛屾殏鏃舵病鏈夎瘎璁 #" "# ###################### #" - "# 共00000条回复 > :#" + "# 鍏00000鏉″洖澶 > :#" "#################################################", "#################################################" - "# [头像] 绝伦N lv6 UP #" - "# [一个] #" - "# 肥肠抱歉,暂时没有评论 #" + "# [澶村儚] 缁濅鸡N lv6 UP #" + "# [涓涓猐 #" + "# 鑲ヨ偁鎶辨瓑锛屾殏鏃舵病鏈夎瘎璁 #" "# ###################### #" - "# 共00000条回复 > :#" + "# 鍏00000鏉″洖澶 > :#" "#################################################", // 51-55 "#################################################" - "# [头像] 绝伦N lv6 UP #" - "# [一个] #" - "# 肥肠抱歉,暂时没有评论 #" + "# [澶村儚] 缁濅鸡N lv6 UP #" + "# [涓涓猐 #" + "# 鑲ヨ偁鎶辨瓑锛屾殏鏃舵病鏈夎瘎璁 #" "# ###################### #" - "# 共00000条回复 > :#" + "# 鍏00000鏉″洖澶 > :#" "#################################################", "#################################################" - "# [发条友善的评论 ] 0v0 #" + "# [鍙戞潯鍙嬪杽鐨勮瘎璁 ] 0v0 #" "#################################################", - " 热门评论 Ξ按时间 ", + " 鐑棬璇勮 螢鎸夋椂闂 ", " ", " ", // 56-60 " ", @@ -390,37 +390,37 @@ char appMapIcon[100][1000] = { " ", " ", }; -//结构体设计 +//缁撴瀯浣撹璁 struct User { - int uid; // b站uid - char head[L * L]; //头像 - char userName[N]; //用户名 - int coin; //硬币数 - int lv; // b站等级 - //下标0位是计数位,不存信息 - int concern[M]; //关注 - int follower[M]; //粉丝 - int myVideos[M]; //我的视频 - int collectVideos[M]; //我收藏的视频 + int uid; // b绔檜id + char head[L * L]; //澶村儚 + char userName[N]; //鐢ㄦ埛鍚 + int coin; //纭竵鏁 + int lv; // b绔欑瓑绾 + //涓嬫爣0浣嶆槸璁℃暟浣嶏紝涓嶅瓨淇℃伅 + int concern[M]; //鍏虫敞 + int follower[M]; //绮変笣 + int myVideos[M]; //鎴戠殑瑙嗛 + int collectVideos[M]; //鎴戞敹钘忕殑瑙嗛 }; struct Vedio { - int vid; //视频唯一编号 - char title[N]; //标题 - char intro[2 * N]; //简介 - char cover[LL * LL]; //封面 - //视频统计量/观看/点赞/投币/收藏/ + int vid; //瑙嗛鍞竴缂栧彿 + char title[N]; //鏍囬 + char intro[2 * N]; //绠浠 + char cover[LL * LL]; //灏侀潰 + //瑙嗛缁熻閲/瑙傜湅/鐐硅禐/鎶曞竵/鏀惰棌/ int viewNum, likeNum, coinNum, collectNum; - char viewTime[N]; //#播放时长 - char comment[M]; //#评论 + char viewTime[N]; //#鎾斁鏃堕暱 + char comment[M]; //#璇勮 }; -//一些系统功能函数 -void HideCursor() //光标隐藏 +//涓浜涚郴缁熷姛鑳藉嚱鏁 +void HideCursor() //鍏夋爣闅愯棌 { - CONSOLE_CURSOR_INFO cursor_info = {1, 0}; //后边的0代表光标不可见 + CONSOLE_CURSOR_INFO cursor_info = {1, 0}; //鍚庤竟鐨0浠h〃鍏夋爣涓嶅彲瑙 SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info); } -void gotoxy(int x, int y) //让光标移动到坐标去打印内容函数 +void gotoxy(int x, int y) //璁╁厜鏍囩Щ鍔ㄥ埌鍧愭爣鍘绘墦鍗板唴瀹瑰嚱鏁 { HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); COORD pos; @@ -428,34 +428,34 @@ struct Vedio { pos.Y = y; SetConsoleCursorPosition(handle, pos); } -void fixedWindow() { //可以忽略 - HWND hWnd = GetConsoleWindow(); //获得cmd窗口句柄 +void fixedWindow() { //鍙互蹇界暐 + HWND hWnd = GetConsoleWindow(); //鑾峰緱cmd绐楀彛鍙ユ焺 RECT rc; - GetWindowRect(hWnd, &rc); //获得cmd窗口对应矩形 - //改变cmd窗口风格 + GetWindowRect(hWnd, &rc); //鑾峰緱cmd绐楀彛瀵瑰簲鐭╁舰 + //鏀瑰彉cmd绐楀彛椋庢牸 SetWindowLongPtr(hWnd, GWL_STYLE, GetWindowLong(hWnd, GWL_STYLE) & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX & ~WS_MINIMIZEBOX); - //因为风格涉及到边框改变,必须调用SetWindowPos,否则无效果 + //鍥犱负椋庢牸娑夊強鍒拌竟妗嗘敼鍙橈紝蹇呴』璋冪敤SetWindowPos锛屽惁鍒欐棤鏁堟灉 SetWindowPos(hWnd, NULL, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, NULL); } -void setColor(short x) //自定义函根据参数改变颜色 +void setColor(short x) //鑷畾涔夊嚱鏍规嵁鍙傛暟鏀瑰彉棰滆壊 { - // if (x >= 0 && x <= 15) //参数在0-15的范围颜色 + // if (x >= 0 && x <= 15) //鍙傛暟鍦0-15鐨勮寖鍥撮鑹 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), - x); //只有一个参数,改变字体颜色 - /* else //默认的颜色白色 + x); //鍙湁涓涓弬鏁帮紝鏀瑰彉瀛椾綋棰滆壊 + /* else //榛樿鐨勯鑹茬櫧鑹 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);*/ } -//一些系统功能函数 +//涓浜涚郴缁熷姛鑳藉嚱鏁 void debug() { static int x = 0, y = 0; static char flag = '#'; - //按下数字就会切换到对应的东西打印方便画画 + //鎸変笅鏁板瓧灏变細鍒囨崲鍒板搴旂殑涓滆タ鎵撳嵃鏂逛究鐢荤敾 char print[11] = " !@#$%^&*("; - int nextgo[4][2] = {-1, 0, 0, 1, 1, 0, 0, -1}; //顺时针wdsa下一步的移动 + int nextgo[4][2] = {-1, 0, 0, 1, 1, 0, 0, -1}; //椤烘椂閽坵dsa涓嬩竴姝ョ殑绉诲姩 int bookMap[128] = {0}; bookMap['w'] = 0, bookMap['d'] = 1; bookMap['s'] = 2, bookMap['a'] = 3; @@ -472,14 +472,14 @@ void debug() { gotoxy(0, 20), printf("x=%d y=%d nowturn='%c'", x, y, flag); } } -void printCuttingLine(int deep, char wall = '-') { ///打印分割线 +void printCuttingLine(int deep, char wall = '-') { ///鎵撳嵃鍒嗗壊绾 for (int i = 1; i < WIDTH - 1; i++) { gotoxy(i, deep); printf("%c", wall); } } -//打印组件函数区域: -void printBoder() { //打印边框 +//鎵撳嵃缁勪欢鍑芥暟鍖哄煙锛 +void printBoder() { //鎵撳嵃杈规 setColor(Boder_Color); for (int i = 0; i < HEIGHT; i++) { for (int j = 0; j < WIDTH; j++) { @@ -491,22 +491,22 @@ void debug() { } } setColor(Normal_Color); - //打印page内置分割线 - int mapHeight = appMap[nowPage][0][0]; //获取地图高度 + //鎵撳嵃page鍐呯疆鍒嗗壊绾 + int mapHeight = appMap[nowPage][0][0]; //鑾峰彇鍦板浘楂樺害 int cuttingLine = - appMap[nowPage][mapHeight][0]; //再最后一行0位获取分割线个数 + appMap[nowPage][mapHeight][0]; //鍐嶆渶鍚庝竴琛0浣嶈幏鍙栧垎鍓茬嚎涓暟 for (int i = 0; i < cuttingLine; i++) { printCuttingLine(appMap[nowPage][mapHeight][i + 1]); } } -//万能字符打印模块 +//涓囪兘瀛楃鎵撳嵃妯″潡 void printDemo(int index, bool on = false) { int x = appMapMessage[index][0]; int y = appMapMessage[index][1]; int h = appMapMessage[index][2]; int w = appMapMessage[index][3]; - int turn = appMapMessage[index][4]; //获取填写图标状态 + int turn = appMapMessage[index][4]; //鑾峰彇濉啓鍥炬爣鐘舵 char prePrint[h + 1][WIDTH]; int cnt = 0; if (turn) { @@ -520,10 +520,10 @@ void printDemo(int index, bool on = false) { for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { gotoxy(y + j, x + i); - if (!on) { //未被选中状态 + if (!on) { //鏈閫変腑鐘舵 if (!turn) { printf("#"); - } //什么都没有的内容页 + } //浠涔堥兘娌℃湁鐨勫唴瀹归〉 else if (turn == 1 && (activeIndexTop == index || activeIndexBottom == index) && @@ -536,22 +536,22 @@ void printDemo(int index, bool on = false) { // printf("%c",str[index++]); } else { if (i == 0 || i == h - 1 || j == 0 || j == w - 1) { - //如果当前是首页推荐标签,那么推荐标签应该是常亮的active状态 - //后面则是选中状态 + //濡傛灉褰撳墠鏄椤垫帹鑽愭爣绛撅紝閭d箞鎺ㄨ崘鏍囩搴旇鏄父浜殑active鐘舵 + //鍚庨潰鍒欐槸閫変腑鐘舵 if (turn == 1 && j == 0) { gotoxy(y + j, x + i); if (index >= 9 && index <= 14 || index >= 21 && index <= 24 || index >= 43 && index <= 45) { setColor(Video_Color); - } //视频的样式 + } //瑙嗛鐨勬牱寮 else if (index >= 15 && index <= 19 || index >= 25 && index <= 28 || index >= 37 && index <= 41 || index == 35) { setColor(Is_Selected3_Color); - } //一些错位字符的样式 + } //涓浜涢敊浣嶅瓧绗︾殑鏍峰紡 else - setColor(Is_Selected1_Color); //正常样式 + setColor(Is_Selected1_Color); //姝e父鏍峰紡 printf("%s", prePrint[i]); // printf("%c",str[index++]); }else if (turn == 0) { @@ -569,27 +569,27 @@ void printDemo(int index, bool on = false) { } if (!on && !turn) { gotoxy(20, 20); - printf("肥 肠 抱 歉 "); + printf("鑲 鑲 鎶 姝 "); gotoxy(14, 22); - printf("你 要 找 的 页 面 不 见 了"); + printf("浣 瑕 鎵 鐨 椤 闈 涓 瑙 浜"); gotoxy(17, 24); - printf("作 者 正 在 开 发 中"); + printf("浣 鑰 姝 鍦 寮 鍙 涓"); gotoxy(17, 26); - printf("按 q 返 回 上 一 页"); + printf("鎸 q 杩 鍥 涓 涓 椤"); } } void clsPage() { - //此处写不清除边框代码 + //姝ゅ鍐欎笉娓呴櫎杈规浠g爜 system("cls"); } -void loadPage() { //加载首页菜单 - int book[100] = {0}; //伪预加载,加载过的界面就不再加载 +void loadPage() { //鍔犺浇棣栭〉鑿滃崟 + int book[100] = {0}; //浼鍔犺浇锛屽姞杞借繃鐨勭晫闈㈠氨涓嶅啀鍔犺浇 printBoder(); - int h = appMap[nowPage][0][0] - 2; //减去上下墙体 + int h = appMap[nowPage][0][0] - 2; //鍑忓幓涓婁笅澧欎綋 int w = 5; for (int i = 1; i <= h; i++) { for (int j = 1; j <= w; j++) { - int index = appMap[nowPage][i][j]; //获取对应模块的对应值 + int index = appMap[nowPage][i][j]; //鑾峰彇瀵瑰簲妯″潡鐨勫搴斿 if (!book[index]) printDemo(index, false); book[index] = 1; @@ -597,121 +597,121 @@ void clsPage() { } } -void checkAction(int action) { //引入路由跳转 - if (action == 3) { //消息栏 +void checkAction(int action) { //寮曞叆璺敱璺宠浆 + if (action == 3) { //娑堟伅鏍 nowPage = 5; - } else if (action == 5) { //首页 + } else if (action == 5) { //棣栭〉 nowPage = 1; - } else if (action == 6) { //热门 + } else if (action == 6) { //鐑棬 nowPage = 2; } else if ((action >= 9 && action <= 14) || (action >= 21 && action <= 24)) { onPlay = true; - nowPage = 4; //进入视频详细页面 - } else if (action >= 15 && action <= 19) { //底层标签栏 + nowPage = 4; //杩涘叆瑙嗛璇︾粏椤甸潰 + } else if (action >= 15 && action <= 19) { //搴曞眰鏍囩鏍 if (action == 15) { - activeIndexBottom = 15; //响应变成首页 + activeIndexBottom = 15; //鍝嶅簲鍙樻垚棣栭〉 activeIndexTop = 5; - nowPage = 1; //没写界面先放首页 后面就nowPage要对应内容 + nowPage = 1; //娌″啓鐣岄潰鍏堟斁棣栭〉 鍚庨潰灏眓owPage瑕佸搴斿唴瀹 } else nowPage = 0; - } else if (action == 29) { //点击视频模块 则对应停止视频 + } else if (action == 29) { //鐐瑰嚮瑙嗛妯″潡 鍒欏搴斿仠姝㈣棰 if (!stopPlay) stopPlay = true; else stopPlay = false; } else { - nowPage = 0; // 没写的界面404 + nowPage = 0; // 娌″啓鐨勭晫闈404 } - activeIndexTop = action; //判断完再切回来 + activeIndexTop = action; //鍒ゆ柇瀹屽啀鍒囧洖鏉 } void move() { - //处理初始数据 + //澶勭悊鍒濆鏁版嵁 static int x = 1, y = 1; static int oldPage = nowPage; int oldX = x, oldY = y; int nextgo[5][2] = {0, 0, -1, 0, 0, - 1, 1, 0, 0, -1}; //顺时针wdsa下一步的移动 + 1, 1, 0, 0, -1}; //椤烘椂閽坵dsa涓嬩竴姝ョ殑绉诲姩 int bookMap[128] = {0}; bookMap['w'] = 1, bookMap['d'] = 2; bookMap['s'] = 3, bookMap['a'] = 4; - //取到当前位置 - //一个index下标位置就存储了一个action + //鍙栧埌褰撳墠浣嶇疆 + //涓涓猧ndex涓嬫爣浣嶇疆灏卞瓨鍌ㄤ簡涓涓猘ction int index = appMap[nowPage][x][y]; int oldIndex = index; - printDemo(index, false); //回退上次的位置 + printDemo(index, false); //鍥為涓婃鐨勪綅缃 char turn = _getch(); x += nextgo[bookMap[turn]][0]; y += nextgo[bookMap[turn]][1]; index = appMap[nowPage][x][y]; - if (index == 0) { //如果是边界则回退 + if (index == 0) { //濡傛灉鏄竟鐣屽垯鍥為 x = oldX, y = oldY; - } else { //负责就移动到下一个新的位置 + } else { //璐熻矗灏辩Щ鍔ㄥ埌涓嬩竴涓柊鐨勪綅缃 while (oldIndex == index && index != 0 && bookMap[turn] != 0) { x += nextgo[bookMap[turn]][0]; y += nextgo[bookMap[turn]][1]; index = appMap[nowPage][x][y]; - } // while就是跳过占多个坐标的状态 + } // while灏辨槸璺宠繃鍗犲涓潗鏍囩殑鐘舵 if (index == 0) x = oldX, y = oldY; } index = appMap[nowPage][x][y]; - printDemo(index, true); //打印新的状态 + printDemo(index, true); //鎵撳嵃鏂扮殑鐘舵 if (turn == ' ' || turn == 'q') { if (turn == ' ') { checkAction(index); } else { onPlay = false; stopPlay = true; - nowPage = 1; //回到首页 + nowPage = 1; //鍥炲埌棣栭〉 } - if (nowPage != oldPage) { //界面变化 + if (nowPage != oldPage) { //鐣岄潰鍙樺寲 oldPage = nowPage; x = 1; y = 1; - clsPage(); //除了边框全部擦除 - loadPage(); //加载新界面 + clsPage(); //闄や簡杈规鍏ㄩ儴鎿﹂櫎 + loadPage(); //鍔犺浇鏂扮晫闈 } } } -void playVideo() { //为对接需要本地文件 - int w = 51; //宽度 - int h = 14; //高度 - int PAGE_LIMIT = 4023; //帧数 - int N = w * h; //字符数 +void playVideo() { //涓哄鎺ラ渶瑕佹湰鍦版枃浠 + int w = 51; //瀹藉害 + int h = 14; //楂樺害 + int PAGE_LIMIT = 4023; //甯ф暟 + int N = w * h; //瀛楃鏁 char str[N]; - char name[] = "badapple/ASCII-序列 010001.txt"; // 13 14 15 16位 + char name[] = "badapple/ASCII-搴忓垪 010001.txt"; // 13 14 15 16浣 int imageNum, tempNum, n = 1, p, q; - //帧操作 + //甯ф搷浣 for (imageNum = 1; imageNum <= PAGE_LIMIT; imageNum++) { if (!onPlay) - return; //杀死线程则返回 - if (stopPlay) { //停止播放则暂停 + return; //鏉姝荤嚎绋嬪垯杩斿洖 + if (stopPlay) { //鍋滄鎾斁鍒欐殏鍋 if (imageNum > 0) imageNum--; } else { int tempNum = imageNum; for (p = 0; p < 4; p++) { - int num = tempNum % 10; //获取第p+1位 + int num = tempNum % 10; //鑾峰彇绗琾+1浣 tempNum /= 10; name[25 - p] = num + '0'; } FILE* fp; - //打开文本 + //鎵撳紑鏂囨湰 if ((fp = fopen(name, "r")) == NULL) { printf("%d", imageNum); system("pause"); continue; } - //读取文本 + //璇诲彇鏂囨湰 int line = 1; while (fgets(str, N, fp) != NULL) { gotoxy(1, line++); printf("%s", str); } - //关闭文本 + //鍏抽棴鏂囨湰 fclose(fp); } int timeLimit = 1000; @@ -726,8 +726,8 @@ void init() { char cmd[50]; sprintf(cmd, "mode con cols=%d lines=%d", WIDTH, HEIGHT); printf("%s", cmd); - system(cmd); //设置界面大小 - system("color 07"); //设置界面颜色。 + system(cmd); //璁剧疆鐣岄潰澶у皬 + system("color 07"); //璁剧疆鐣岄潰棰滆壊銆 fixedWindow(); for (int i = 0; i < HEIGHT; i++) { for (int j = 0; j < WIDTH; j++) { @@ -743,14 +743,14 @@ void init() { } int main() { - // ctrl+滚轮可以调大界面 + // ctrl+婊氳疆鍙互璋冨ぇ鐣岄潰 init(); while (1) { if (onPlay) { playVideo(); } if (kbhit()) { - // debug(); //开启debug就会显示坐标信息,并且注释move() + // debug(); //寮鍚痙ebug灏变細鏄剧ず鍧愭爣淇℃伅锛屽苟涓旀敞閲妋ove() move(); } } diff --git "a/\345\223\224\345\223\251\345\223\224\345\223\251\347\247\273\345\212\250\347\253\257/BilibiliDemo.exe" "b/\345\223\224\345\223\251\345\223\224\345\223\251\347\247\273\345\212\250\347\253\257/BilibiliDemo.exe" new file mode 100644 index 0000000..0917117 Binary files /dev/null and "b/\345\223\224\345\223\251\345\223\224\345\223\251\347\247\273\345\212\250\347\253\257/BilibiliDemo.exe" differ diff --git "a/\346\211\223\347\240\226\345\235\227\347\211\251\347\220\206\347\211\210/\346\211\223\347\240\226\345\235\227\347\211\251\347\220\206\347\211\210.txt" "b/\346\211\223\347\240\226\345\235\227\347\211\251\347\220\206\347\211\210/\346\211\223\347\240\226\345\235\227\347\211\251\347\220\206\347\211\210.txt" index 69b54a1..c07ee53 100644 --- "a/\346\211\223\347\240\226\345\235\227\347\211\251\347\220\206\347\211\210/\346\211\223\347\240\226\345\235\227\347\211\251\347\220\206\347\211\210.txt" +++ "b/\346\211\223\347\240\226\345\235\227\347\211\251\347\220\206\347\211\210/\346\211\223\347\240\226\345\235\227\347\211\251\347\220\206\347\211\210.txt" @@ -1,19 +1,3 @@ -/*----------------------------------- -绋嬪簭 锛 鎵撶爾鍧楋紙鐗╃悊鐗堬級 -浣滆 锛 404name -瀹屾垚鏃堕棿锛 2020.3.15 - -娓告垙榛樿鍦板浘鍧囬噰鐢╢or寰幆+閫昏緫鏋勫缓鎵浠ワ紝骞舵病鏈夌洿鎺ュ垵濮嬪寲鍦板浘 - -瀹炵幇鍘熺悊: autochange() 鍑芥暟娉ㄩ噴閭i噷 - -bug锛 1.鐩墠瀵硅鐩哥鏄繘琛岀殑鐩存帴鎵撶牬璇ユ柟鍧楋紝鍥犱负娴嬭瘯鍒拌繘琛屾甯哥殑纰版挒杩斿洖浼氶噸澶嶄箣鍓嶇殑璺 锛堢畻鏄紭鍖栵級 - 2.鏈煡鐨勫師鍥犲鑷村紑灞褰卞瓙鑴辫妭锛岀洰鍓嶅凡缁忎紭鍖栧埌鍚庢湡鍑犱箮鐪嬩笉鍒拌劚鑺傘 - -浼樺寲锛 瀹炵幇绫讳技璐悆铔囩帺娉曪紝鍒堕犺窡闅忕殑绉诲姩杞ㄨ抗锛屽苟涓斾氦鍙夌殑绉诲姩杞ㄨ抗涓嶄細鐩存帴娓呴櫎瀵艰嚧鑴辫妭銆 - 閰嶈壊浼樺寲 - ----------------------------------*/ #include //鐢ㄤ簬getch锛堬級 #include #include @@ -21,76 +5,17 @@ bug锛 1.鐩墠瀵硅鐩哥鏄繘琛岀殑鐩存帴鎵撶牬璇ユ柟鍧楋紝鍥犱负娴嬭瘯鍒 #include #include #define pi 3.14 -const double g = 10; //鏍囧噯鏁拌秺妯$硦锛岃建杩硅秺杩炶疮銆 +const double g = 10; //闈炴爣鍑嗘鍧愭爣绯 +/*------------------------ -//---------------------------------------------------------------------------------------------------------------------------------- -// 绯荤粺榛樿鐢熸垚鍏冲崱鍦板浘锛岃嫢鎯宠嚜宸辨敼閫犲叧鍗¤灏1 璁剧疆涓0骞朵笖鍐嶄笅鏂瑰垵濮嬪寲鍦板浘锛堥粡璐村湴鍥撅級 -int auto_made_map = 1; -char man_made_map[1000][1000]; -//--------------------------------------------------------------------------------------------------------------------------------- -char map[1000][1000]; -char End[200][800] = { - {"## ## ## ## # "}, - {" ## # ##### ###### ## ## "}, - {" ##### ###### ###### ## # "}, - {" ####### ## ###### "}, - {"## ## # ##### ########## "}, - {" ## #### ##### ## ###### "}, - {" #### ## ## ## ## # "}, - {" ## # ###### ### ## ## "}, - {" # ## # ###### ## ## ## "}, - {" # ## # ## #### ### "}, - {" ## ## # ## ## # ## #"}, - {" # ## # ## ## #### ##"}, - {"## ### # ### # ### ####"}, - {"## ## ## ## ## ###"}, - {" "}, - {" ## ## ## "}, - {" ## ######### ###############"}, - {" ## ######### ###############"}, - {"## ## ## ## "}, - {"###### ####### ############ "}, - {" ## ####### ############ "}, - {" ## ## ## ## "}, - {"###### ####### ############ "}, - {"###### ####### ##### "}, - {" ## ## ## #### "}, - {" ### ## ## ## ## ## "}, - {"###### ####### ### ## ### "}, - {"### ####### ## ## ## "}, - {" ## ## ## "}, - {" "}, - {" 鎸 涓 娆 鍥 杞 缁 缁 "}, -}; -char menu[40][40] = { - {" <---------------> "}, - {" < 鎵 鐮 鍧 > "}, - {" <---------------> "}, - {" "}, - {" <1> 寮濮嬫父鎴 <$> "}, - {" "}, - {" <2> 璐悆铔噈od <$> "}, - {" "}, - {" <3> 缂栬緫鍦板浘 <$> "}, - {" "}, - {" <4> 閫鍑烘父鎴 <$> "}, - {" "}}; - -//鍏ㄥ眬鍙橀噺鍖猴紝鍦╥nit閲岄潰鏀瑰彉 -char wall, food, air, brick; -int width, length; -double X, Y, x, y, Vx, Vy, t, V; //榛樿鍚戜笅鍚戝彸涓烘 -int old_x, old_y, head, tail, max, step, if_miss, food_num, goal, color; -int if_start, if_load_snake_mod, debug, life; //debug妯″紡璋冩垚1鎵嬪姩寮鍚 -int temp_x, temp_y, menu_x, menu_y, left, right; //涓存椂鍧愭爣 -double C[8] = {0, 10, 30, 70, 90}; //鍒濆鏂滄姏鐨勮搴︼紝鑷彸鍚戜笂杞(鐩墠宸茶皟鏁村ソ鏈濂界殑瑙掑害) - -struct Step //杞ㄨ抗 -{ - int x; - int y; -} s[1000]; +娉ㄦ剰锛氳繖閲屾槸鐢ㄧ殑cpp鍐欑殑锛岃鏀筩璇█鍒欏彧瑕佹妸鍏ㄥ眬鍙橀噺鍒濆鍖栨斁杩沬nit閲岄潰鍗冲彲 +鏂滄姏杩愬姩灏廳emo + +鍘熺悊鍓嶅線main鍑芥暟 + +鑻ヨ鍙栨秷璐悆铔囪灏唂ood鍙樹负0 +--------------------------*/ void HideCursor() //鍏夋爣闅愯棌 { CONSOLE_CURSOR_INFO cursor_info = {1, 0}; //鍚庤竟鐨0浠h〃鍏夋爣涓嶅彲瑙 @@ -106,153 +31,227 @@ void gotoxy(int x, int y) //鍧愭爣鍑芥暟 SetConsoleCursorPosition(handle, pos); } +//鍙橀噺鍖 +char map[1000][1000]; +int width = 40, length = 150; +double X, Y, x, y, Vx, Vy, t; +int old_x, old_y, head = 0, tail = 0, max = 60, step = 0, if_miss = 0, food = 500, color = 0; + +struct Step +{ + int x; + int y; +} s[1000]; + +//double C[8] = {0,10,30,70,90}; + +double C = 70; //鍙皟鏁寸殑瑙掑害锛岃嚜鍙冲悜涓婅浆瑙 0-姘村钩鍑哄皠 90鍨傜洿涓婃姏 + void init() { - int i, j, a, b; + printf("濡傛灉鑺卞睆鍒欒皟鏁翠负18瀛楀彿锛堜笉鍚岀數鑴戝彲鑳芥儏鍐典笉鍚岋級\n鎸夊洖杞﹀紑濮"); + getchar(); HideCursor(); - width = 40, length = 150; - wall = '#', food = '*', air = ' ', brick = 'O'; - head = 0, tail = 0, max = 60, step = 0, if_miss = 0, food_num = 400, goal = 0, color = 0; - debug = 0, life = 3; //debug妯″紡璋冩垚1鎵嬪姩寮鍚 - temp_x = 2, temp_y = 2, menu_x = 18, menu_y = 68, left = 4, right = 20; //涓存椂鍧愭爣 gotoxy(0, 0); - - //鑿滃崟妯″紡 - if (if_start == 0) - { //棣栭〉 - for (i = 0; i <= width; i++) - { //鐢熸垚鍦板浘妯℃澘 - for (j = 0; j <= length; j++) - { - if (i == 0 || i == width || j == 0 || j == length) - map[i][j] = wall; - else if ((i == width / 3 || i == width * 2 / 3) && (j >= length * 2 / 5 && j <= length * 3 / 5)) - map[i][j] = wall; - else if ((i >= width / 3 && i <= width * 2 / 3) && (j == length * 2 / 5 || j == length * 3 / 5)) - map[i][j] = wall; - else - map[i][j] = air; - } - } - while (food_num--) - { //璐悆铔囩敓鎴愰鐗 - int a = rand() % width; - int b = rand() % length; - if ((a >= width / 3 && a <= width * 2 / 3) && (b >= length * 2 / 5 && b <= length * 3 / 5) || a == 0 || b == 0) - continue; - map[a][b] = food; - } - for (i = 0; i <= width; i++) - { //甯冪疆鐮栧潡brick - for (j = 0; j <= length; j++) - { - if ((i == 15 || i == 20) && ((j >= 4 && j <= 50) || (j >= 100 && j <= 130))) - map[i][j] = brick; - } + for (int i = 0; i <= width; i++){ + for (int j = 0; j <= length; j++){ + if (i == 0 || i == width || j == 0 || j == length) + map[i][j] = '#'; + else + map[i][j] = ' '; } } - //娓告垙妯″紡 - else if (if_start == 1 || if_start == -1) - { - if (auto_made_map == 1) - { - for (i = 0; i <= width; i++) - { //鐢熸垚鍦板浘妯℃澘 - for (j = 0; j <= length; j++) - { - if (i == 0 || i == width || j == 0 || j == length) - map[i][j] = wall; - else if ((i == width * 2 / 3) && (j >= length * 2 / 5 && j <= length * 3 / 5)) - map[i][j] = wall; - else if (i == width - 1 && j >= left && j <= right) - map[i][j] = wall; - else - map[i][j] = air; - } - } - if (if_load_snake_mod == 1) - { - food_num = 400; - while (food_num--) - { //璐悆铔囩敓鎴愰鐗 - a = rand() % width; - b = rand() % length; - if ((a >= width / 3 && a <= width * 2 / 3) && (b >= length * 2 / 5 && b <= length * 3 / 5) || a == 0 || b == 0) - continue; - map[a][b] = food; - } - } - for (i = 0; i <= width; i++) - { //甯冪疆鐮栧潡brick - for (j = 0; j <= length; j++) - { - if (((i >= 14 && i <= 15) && (j >= 1 && j <= 20)) || ((i >= 14 && i <= 15) && (j >= 130 && j <= 149))) - map[i][j] = brick; - if (((i >= 20 && i <= 22) && (j >= 10 && j <= 50)) || ((i >= 20 && i <= 22) && (j >= 100 && j <= 140))) - map[i][j] = brick; - if ((i == 10 || i == 11) && ((j >= 10 && j <= 50) || (j >= 100 && j <= 140))) - map[i][j] = brick; - } - } - } - else - { - for (i = 0; i <= width; i++) - { - strcpy(map[i], man_made_map[i]); - } - auto_made_map = 1; - } - gotoxy(2, width + 3); - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); - printf("life:"); - for (i = 0; i < life; i++) - printf("鈻"); + while (food--){ + int a = rand() % width; + int b = rand() % length; + map[a][b] = '*'; } - gotoxy(0, 0); - for (i = 0; i <= width; i++) - { //鎵撳嵃鍦板浘 - for (j = 0; j <= length; j++) - { - if (if_start == 0 && i >= 14 && i <= 25 && j >= 61 && j <= 89) - map[i][j] = menu[i - 14][j - 61]; - if (map[i][j] == wall && if_start != -1) - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 60); - else if (map[i][j] == brick && if_start != -1) - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 80); - else - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); - if (i == width) - printf("!"); - else - printf("%c", map[i][j]); + for (int i = 0; i <= width; i++){ + for (int j = 0; j <= length; j++){ + printf("%c", map[i][j]); } printf("\n"); } - //鏋勫缓鍒濆浣嶇疆浠ュ強閫熷害鍜屾柟鍚戣搴 - X = width - 5; + X = width - 5; //璁剧疆鍒濆浣嶇疆 Y = 4; - old_x = (int)X; - old_y = (int)Y; + old_x = X; + old_y = Y; s[step].x = old_x; - s[step].y = old_y; - V = 26; - Vx = -V * sin(C[3] * pi / 180.0); //閫熷害鍚戝彸鍚戜笅涓烘鏂瑰悜 - Vy = V * cos(C[3] * pi / 180.0); + s[step].y = old_y; //寰幆缁撴瀯浣撳偍瀛樷滆泧鈥濈殑韬綋 + int V = 25, cut = 0; //鍒濋熷害 + Vx = -V * sin(C * pi / 180.0); //鍒嗚В閫熷害 + Vy = V * cos(C * pi / 180.0); //閫熷害鍚戝彸鍚戜笅涓烘鏂瑰悜 } -void gameover() +int main() { - int i, j; - gotoxy(0, 0); - for (i = 0; i <= width + 6; i++) - { - for (j = 0; j <= length; j++) + init(); + int cnt = 10000; //鑷繁璁剧疆锛屽彲浠ユ棤闄 + int flag = 1; //鍒ゆ柇鎯呭喌 + + //涓昏绠楁硶鍖哄煙 + while (cnt--){ + double t1, t2; + double s1, s2; + //杩欓噷鐨勨滆建杩光濇槸瀛樺湪鈥滃惊鐜槦鍒椻濈殑缁撴瀯浣撲腑鐨 + //map鏁扮粍涓寮濮嬪彧鎵撳嵃涓娆★紝闅忓悗鍦ㄥ師鏁扮粍涓婄殑鏀瑰彉涓嶄細浣滅敤鏄剧ず銆 + //鏄剧ず杞ㄨ抗鐨勫叾瀹炶繕鏄墦鍗扮┖鏍硷紝浣嗕笉鍚岀殑鏄鑹 + //娑堝幓杞ㄨ抗涔熸墦鍗扮櫧鑹茬殑绌烘牸锛歋etConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); + /*------------------------------------------------------- + 鏍稿績鍏紡锛 X = X0 + Vx * t + 1/2 * VX * t * t; + Y = Y0 + Vy * t; + 鏍稿績鎬濇兂锛 路濡傛灉閫夋嫨鏃堕棿浣滀负绉诲姩鍙傝冿紝鍒欐瘡绉掍細鍑虹幇鐐圭浉宸お杩 + 闅句互瀹炵幇杩炵画銆 + 路杩欓噷鍙嶈繃鏉ワ紝浠ヨ繛缁负鍓嶆彁锛屽皾璇曟壘鍑烘瘡绉诲姩涓涓崟浣 + 闇瑕佸灏戞椂闂达紝鍒欒兘渚濇鎵惧嚭涓涓繛缁殑鏇茬嚎銆 + + 鍑虹幇闂锛 c璇█鏁扮粍鍙兘鏄暣鏁帮紝鎵浠ョЩ鍔ㄦ柟鍚戝彧鑳藉瓨鍦ㄦ按骞冲拰绔栫洿锛 + 涓嶈兘渚濈収杩愬姩鏂瑰悜瀹炵幇寰鏌愪釜鐗瑰畾鐨勮搴︾Щ鍔ㄤ竴涓崟浣嶃 + 骞朵笖瑕佹帓闄ゆ柇鑺傞棶棰橈紙鍗虫墦鍗扮殑鏇茬嚎鏂柇缁画锛 + + 瑙e喅鏂规硶锛 鎶婄壒绉诲姩鏂瑰悜绉诲姩鍗曚綅鍒嗚В鍒癤锛孻涓娿 + 鍒嗗埆绠楀嚭 X 澧炲姞涓涓崟浣嶉暱搴 搴旇澧炲姞鐨 Y 鐨勮窛绂 s1 <=> flag == 1 + Y 澧炲姞涓涓崟浣嶉暱搴 搴旇澧炲姞鐨 X 鐨勮窛绂 s2 <=> flag == 2 + + 浼樺厛閫夋嫨鏇寸煭鐨刴in锛坰1,s2),鐒跺悗浠lag瀵瑰簲涓嶅悓鐨勬ā寮忎綔涓轰笅涓娆$Щ鍔ㄧ殑鍩哄噯銆 + 杩欐牱鎿嶄綔鑳戒繚璇佺嚎娈典粎浠呭彧鍦ㄦ按骞充笌绔栫洿鏂瑰悜绉诲姩鏃剁嚎娈典粛鑳借繛缁 + + 鎵撲釜姣旀柟锛氫竴娈垫枩鐜囦负2鐨勭洿绾 + x澧炲姞1 Y澧炲姞2浣犵湅锛岃繖閲孻鑴辫妭浜嗕細涓涓嬪瓙鍦╕涓婄Щ鍔ㄤ簡2鏍笺 + 浣嗗疄闄呬笂鎴戜滑鐪 + Y澧炲姞1 X瀹為檯涓婂彧澧炲姞0.5. + 鎵浠ヤ竴娈垫洸绾匡紝浠栫殑寰厓鏋勬垚鐨勭洿绾夸笉绠℃枩鐜囧鍋忓兓锛岄兘鑳借繛缁墦鍗般 + 杩欏氨鏄负浠涔堝彇min锛坰1,s2锛夊喅瀹氱Щ鍔ㄦā寮忕殑鍘熷洜銆 + 杩欐牱鑳戒繚璇佷粎浠呭彧鍦ㄤ笂绉诲姩涓涓崟浣峣nt锛圷锛夛紝鑰宨nt锛圶锛夋槸涓嶅鍔犵殑锛屾诞鐐瑰瀷鐨刋鍙堟妸閲忕疮璁″埌涓嬩竴娆″湪鍒ゆ柇銆 + + 鏈鍚庡疄鐜帮細 + X锛孻鐢╠ouble鍌ㄥ瓨锛屼繚璇佸疄闄呭彔鍔犺兘杩炵画锛 + 鑰屽疄闄呮墦鍗帮紝鏄笉鑳借锛5,6.28锛夎繖鏍风殑娴偣鍨嬭兘鍦╟璇█涓婃墦鍗帮紝鎵浠ユ垜浠噰鐢╥nt鏁村瀷鐨刼ld_x,old_y鏉ユ壙鎺锛孻浠ヤ究浜庢墦鍗板湪灞忓箷涓娿 + + 鎴戜滑鎸夌収鏃堕棿涓哄惊鐜彧鑳藉湪灞忓箷涓婃墦鍗颁竴涓叉柇鏂画缁殑绫绘姏鐗╃嚎鐨勭偣銆 + 浣嗘垜浠寜鐓ц蛋涓涓滄柟鍚戝崟浣嶁濓紝渚濇绫诲彔锛屾垜浠氨鑳藉緱鍒颁竴涓茶繛缁殑绾裤 + + 缁撴灉瀹炵幇锛 鐢变簬锛岀畻娉曞亸鍚戜笉涓ヨ皑锛屽彲鑳戒細鍑虹幇灏忛儴鍒嗗紑灞鏂妭bug锛屼絾闅忕潃寰幆鎺ㄨ繜锛屽悗鏈熻兘100%杩炵画锛侊紒 + + 鍔犲叆浜轰负淇 + + 缁忔祴璇曞皬鑼冨洿鐨勬暟鎹兘瀹岀編鎵撳嵃鍑虹墿鐞嗘姏鐗╃嚎锛侊紒锛 + ------------------------------------------------------------*/ + //绠楁硶璧风偣锛 + + //浜屻佸綋Y澧炲姞涓涓崟浣嶆柟鍚戞椂 锛堟妸杩欎釜绠鍗曠殑鏀惧墠闈㈠彲浠ョ被姣旂煡閬撳悗闈閭i噷鍦ㄥ共鍢涳級 + t2 = 1.0 / fabs(Vy); + s2 = Vx * t2 + 0.5 * g * t2 * t2; + + //涓銆佸綋X鏀瑰彉涓涓崟浣嶆柟鍚戞椂锛堣冭檻锛 + // 1/2 g*t*t + vx * t = 1 瑙d竴鍏冧簩娆℃柟绋嬶紙杩欓噷鍒ゆ柇 澧炲姞鍚庡噺灏戜粛鐒舵槸1 鍙兘浼氭湁4绉嶆儏鍐碉級 + //灏辩敤鍏紡瑙h繖涓5*t*t + Vx t - 1= 0;锛堟璐1锛 + //鎴戣繖閲岀殑纭鏉備簡锛屼絾鏄繚闄╋紝濡傛灉鑳借璁℃洿濂界殑绠楁硶灏卞彲浠ュ璇曡瘯銆 + double temp; + double x1_t1 = (-Vx + sqrt(Vx * Vx + 20)) / 10; + double x2_t1 = (-Vx - sqrt(Vx * Vx + 20)) / 10; + double x3_t1 = (-Vx + sqrt(Vx * Vx - 20)) / 10; + double x4_t1 = (-Vx - sqrt(Vx * Vx - 20)) / 10; + if (x1_t1 > 0 && x2_t1 > 0) + t1 = x1_t1 < x2_t1 ? x1_t1 : x2_t1; + else + t1 = x1_t1 >= 0 ? x1_t1 : x2_t1; + if (x3_t1 > 0 && x4_t1 > 0) + temp = x3_t1 < x4_t1 ? x3_t1 : x4_t1; + else if (x3_t1 * x4_t1 < 0) + temp = x3_t1 >= 0 ? x3_t1 : x4_t1; + else + temp = 10; + t1 = t1 < temp ? t1 : temp; + //杩欓噷涓昏灏变负浜嗘眰涓涓猼1 + s1 = t1 * Vy; + + //杩涜鎷╃煭鍒ゆ柇 + if ((int)s1 == 0) + flag = 1; + else if ((int)s2 == 0) + flag = 2; + else + flag = s1 < s2 ? 1 : 2; + //閫夋嫨鏈浼樿繘琛屽鐞 + if (flag == 1){ + X = X + Vx * t1 + 5 * t1 * t1; //绛変环浜 X = X +- 1 锛堝洜涓洪熷害鏄甫鏂瑰悜鐨勶紝姹傚嚭鏃堕棿鍦ㄥ弽杩囨潵姹1姝ゆ椂鐨1涔熸槸甯︽璐熷彿鐨勫氨涓嶈鍒嗙被鑰冭檻浜嗭級 + Y = Y + s1; //X鏀瑰彉1 Y鐞嗚涓婃敼鍙樼殑澶у皬銆 + Vx = Vx + g * t1; + } + else if (flag == 2){ + Y = Y + Vy * t2; //绛変环浜 Y = Y +- 1 + X = X + s2; //Y鏀瑰彉1 X鐞嗚涓婃敼鍙樼殑澶у皬銆 + Vx = Vx + g * t2; + } + + old_x = (int)X; //鏁村瀷鎵挎帴涓嬩竴姝ョ殑绉诲姩鍚庨潰瀛樺叆寰幆缁撴瀯浣撴暟缁勪互鎵撳嵃 + old_y = (int)Y; + //绠楁硶缁堢偣 + //-------------------------------------------------------------------------------------------------------- + //涔嬪悗鏄晫闈㈡敼鍙橀昏緫瀹炵幇 + //纰板鏀瑰彉鏂瑰悜 + if (X >= width - 2 || X <= 2){ + color = (color + 1) % 5; + Vx = -Vx; + } + if (Y >= length - 2 || Y <= 2){ + color = (color + 1) % 5; + Vy = -Vy; + } + + //娑堥櫎鏈熬鑺傜偣 + if (if_miss == 1){ + //map鏄悗鍙版暟缁勶紝濡傛灉韬綋缁忚繃涓娆″氨++锛屾秷鍘讳竴娆″氨--鐩村埌鍥炲鍘熸潵鐘舵佸氨鍙互鎵撳嵃娑堝幓銆傞槻姝㈣嚜宸卞悆鎺夎嚜宸辩殑韬綋 + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); + gotoxy(s[step].y, s[step].x); + map[s[step].x][s[step].y]--; + if (map[s[step].x][s[step].y] == ' ') //闃叉鑷繁鍚冭嚜宸 + printf(" "); + } + s[step].x = old_x; + s[step].y = old_y; + + if (map[s[step].x][s[step].y] == '*') //锛堣椽鍚冭泧妯″紡锛夊悆鍒伴鐗╄韩浣撳闀 { - printf(" "); + map[s[step].x][s[step].y] = ' '; + max++; + gotoxy(2, width + 2); + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); + printf("len:%5d", max); } - Sleep(20); + + //鍐冲畾韬綋棰滆壊 + switch (color) + { + case 0: + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 60); + break; //钃濊壊 + case 1: + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 70); + break; //绾㈣壊 + case 2: + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 40); + break; //缁胯壊 + case 3: + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 30); + break; //娣辫摑鑹 + case 4: + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 80); + break; //绱壊 + } + gotoxy(s[step].y, s[step].x); + map[s[step].x][s[step].y]++; + printf(" "); + step++; + if (step >= max) + { + if_miss = 1; //濡傛灉闀垮害寮濮嬪ぇ浜庢渶闀块暱搴﹀氨瑕佸紑濮嬩粠鏈熬娑堥櫎灏捐妭鐐逛簡 + } + step = step % max; + Sleep(10); //鎶10鏀规垚绔栫洿鍧愭爣鍏充簬楂樺害鐨勫叕寮忓彲浠ユā鎷熶笅鍧犵殑鏃跺欓熷害 } +} } gotoxy(0, 0); printf("鍗冲皢閫鍑烘父鎴"); Sleep(2000); diff --git "a/\346\211\223\347\240\226\345\235\227\347\211\251\347\220\206\347\211\210/\346\212\233\347\211\251\347\272\277demo.txt" "b/\346\211\223\347\240\226\345\235\227\347\211\251\347\220\206\347\211\210/\346\212\233\347\211\251\347\272\277demo.txt" index 34b68d6..13ef270 100644 --- "a/\346\211\223\347\240\226\345\235\227\347\211\251\347\220\206\347\211\210/\346\212\233\347\211\251\347\272\277demo.txt" +++ "b/\346\211\223\347\240\226\345\235\227\347\211\251\347\220\206\347\211\210/\346\212\233\347\211\251\347\272\277demo.txt" @@ -1,28 +1,28 @@ -#include //用于getch() +#include //鐢ㄤ簬getch锛堬級 #include #include -#include //用于rand +#include //鐢ㄤ簬rand #include #include #define pi 3.14 -const double g = 10; //非标准正坐标系 +const double g = 10; //闈炴爣鍑嗘鍧愭爣绯 /*------------------------ -注意:这里是用的cpp写的,要改c语言则只要把全局变量初始化放进init里面即可 +娉ㄦ剰锛氳繖閲屾槸鐢ㄧ殑cpp鍐欑殑锛岃鏀筩璇█鍒欏彧瑕佹妸鍏ㄥ眬鍙橀噺鍒濆鍖栨斁杩沬nit閲岄潰鍗冲彲 -斜抛运动小demo +鏂滄姏杩愬姩灏廳emo -原理前往main函数 +鍘熺悊鍓嶅線main鍑芥暟 -若要取消贪吃蛇请将food变为0 +鑻ヨ鍙栨秷璐悆铔囪灏唂ood鍙樹负0 --------------------------*/ -void HideCursor() //光标隐藏 +void HideCursor() //鍏夋爣闅愯棌 { - CONSOLE_CURSOR_INFO cursor_info = {1, 0}; //后边的0代表光标不可见 + CONSOLE_CURSOR_INFO cursor_info = {1, 0}; //鍚庤竟鐨0浠h〃鍏夋爣涓嶅彲瑙 SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info); } -void gotoxy(int x, int y) //坐标函数 +void gotoxy(int x, int y) //鍧愭爣鍑芥暟 { HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); COORD pos; @@ -31,7 +31,7 @@ void gotoxy(int x, int y) // SetConsoleCursorPosition(handle, pos); } -//变量区 +//鍙橀噺鍖 char map[1000][1000]; int width = 40, length = 150; double X, Y, x, y, Vx, Vy, t; @@ -45,11 +45,11 @@ struct Step //double C[8] = {0,10,30,70,90}; -double C = 70; //可调整的角度,自右向上转角 0-水平出射 90垂直上抛 +double C = 70; //鍙皟鏁寸殑瑙掑害锛岃嚜鍙冲悜涓婅浆瑙 0-姘村钩鍑哄皠 90鍨傜洿涓婃姏 void init() { - printf("如果花屏则调整为18字号(不同电脑可能情况不同)\n按回车开始"); + printf("濡傛灉鑺卞睆鍒欒皟鏁翠负18瀛楀彿锛堜笉鍚岀數鑴戝彲鑳芥儏鍐典笉鍚岋級\n鎸夊洖杞﹀紑濮"); getchar(); HideCursor(); gotoxy(0, 0); @@ -72,81 +72,81 @@ void init() } printf("\n"); } - X = width - 5; //设置初始位置 + X = width - 5; //璁剧疆鍒濆浣嶇疆 Y = 4; old_x = X; old_y = Y; s[step].x = old_x; - s[step].y = old_y; //循环结构体储存“蛇”的身体 - int V = 25, cut = 0; //初速度 - Vx = -V * sin(C * pi / 180.0); //分解速度 - Vy = V * cos(C * pi / 180.0); //速度向右向下为正方向 + s[step].y = old_y; //寰幆缁撴瀯浣撳偍瀛樷滆泧鈥濈殑韬綋 + int V = 25, cut = 0; //鍒濋熷害 + Vx = -V * sin(C * pi / 180.0); //鍒嗚В閫熷害 + Vy = V * cos(C * pi / 180.0); //閫熷害鍚戝彸鍚戜笅涓烘鏂瑰悜 } int main() { init(); - int cnt = 10000; //自己设置,可以无限 - int flag = 1; //判断情况 + int cnt = 10000; //鑷繁璁剧疆锛屽彲浠ユ棤闄 + int flag = 1; //鍒ゆ柇鎯呭喌 - //主要算法区域 + //涓昏绠楁硶鍖哄煙 while (cnt--){ double t1, t2; double s1, s2; - //这里的“轨迹”是存在“循环队列”的结构体中的 - //map数组一开始只打印一次,随后在原数组上的改变不会作用显示。 - //显示轨迹的其实还是打印空格,但不同的是颜色 - //消去轨迹也打印白色的空格:SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); + //杩欓噷鐨勨滆建杩光濇槸瀛樺湪鈥滃惊鐜槦鍒椻濈殑缁撴瀯浣撲腑鐨 + //map鏁扮粍涓寮濮嬪彧鎵撳嵃涓娆★紝闅忓悗鍦ㄥ師鏁扮粍涓婄殑鏀瑰彉涓嶄細浣滅敤鏄剧ず銆 + //鏄剧ず杞ㄨ抗鐨勫叾瀹炶繕鏄墦鍗扮┖鏍硷紝浣嗕笉鍚岀殑鏄鑹 + //娑堝幓杞ㄨ抗涔熸墦鍗扮櫧鑹茬殑绌烘牸锛歋etConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); /*------------------------------------------------------- - 核心公式: X = X0 + Vx * t + 1/2 * VX * t * t; + 鏍稿績鍏紡锛 X = X0 + Vx * t + 1/2 * VX * t * t; Y = Y0 + Vy * t; - 核心思想: ·如果选择时间作为移动参考,则每秒会出现点相差太远 - 难以实现连续。 - ·这里反过来,以连续为前提,尝试找出每移动一个单位 - 需要多少时间,则能依次找出一个连续的曲线。 - - 出现问题: c语言数组只能是整数,所以移动方向只能存在水平和竖直, - 不能依照运动方向实现往某个特定的角度移动一个单位。 - 并且要排除断节问题(即打印的曲线断断续续) - - 解决方法: 把特移动方向移动单位分解到X,Y上。 - 分别算出 X 增加一个单位长度 应该增加的 Y 的距离 s1 <=> flag == 1 - Y 增加一个单位长度 应该增加的 X 的距离 s2 <=> flag == 2 + 鏍稿績鎬濇兂锛 路濡傛灉閫夋嫨鏃堕棿浣滀负绉诲姩鍙傝冿紝鍒欐瘡绉掍細鍑虹幇鐐圭浉宸お杩 + 闅句互瀹炵幇杩炵画銆 + 路杩欓噷鍙嶈繃鏉ワ紝浠ヨ繛缁负鍓嶆彁锛屽皾璇曟壘鍑烘瘡绉诲姩涓涓崟浣 + 闇瑕佸灏戞椂闂达紝鍒欒兘渚濇鎵惧嚭涓涓繛缁殑鏇茬嚎銆 + + 鍑虹幇闂锛 c璇█鏁扮粍鍙兘鏄暣鏁帮紝鎵浠ョЩ鍔ㄦ柟鍚戝彧鑳藉瓨鍦ㄦ按骞冲拰绔栫洿锛 + 涓嶈兘渚濈収杩愬姩鏂瑰悜瀹炵幇寰鏌愪釜鐗瑰畾鐨勮搴︾Щ鍔ㄤ竴涓崟浣嶃 + 骞朵笖瑕佹帓闄ゆ柇鑺傞棶棰橈紙鍗虫墦鍗扮殑鏇茬嚎鏂柇缁画锛 + + 瑙e喅鏂规硶锛 鎶婄壒绉诲姩鏂瑰悜绉诲姩鍗曚綅鍒嗚В鍒癤锛孻涓娿 + 鍒嗗埆绠楀嚭 X 澧炲姞涓涓崟浣嶉暱搴 搴旇澧炲姞鐨 Y 鐨勮窛绂 s1 <=> flag == 1 + Y 澧炲姞涓涓崟浣嶉暱搴 搴旇澧炲姞鐨 X 鐨勮窛绂 s2 <=> flag == 2 - 优先选择更短的min(s1,s2),然后以flag对应不同的模式作为下一次移动的基准。 - 这样操作能保证线段仅仅只在水平与竖直方向移动时线段仍能连续 - - 打个比方:一段斜率为2的直线 - x增加1 Y增加2你看,这里Y脱节了会一下子在Y上移动了2格。 - 但实际上我们看 - Y增加1 X实际上只增加0.5. - 所以一段曲线,他的微元构成的直线不管斜率多偏僻,都能连续打印。 - 这就是为什么取min(s1,s2)决定移动模式的原因。 - 这样能保证仅仅只在上移动一个单位int(Y),而int(X)是不增加的,浮点型的X又把量累计到下一次在判断。 - - 最后实现: - X,Y用double储存,保证实际叠加能连续; - 而实际打印,是不能说(5,6.28)这样的浮点型能在c语言上打印,所以我们采用int整型的old_x,old_y来承接X,Y以便于打印在屏幕上。 + 浼樺厛閫夋嫨鏇寸煭鐨刴in锛坰1,s2),鐒跺悗浠lag瀵瑰簲涓嶅悓鐨勬ā寮忎綔涓轰笅涓娆$Щ鍔ㄧ殑鍩哄噯銆 + 杩欐牱鎿嶄綔鑳戒繚璇佺嚎娈典粎浠呭彧鍦ㄦ按骞充笌绔栫洿鏂瑰悜绉诲姩鏃剁嚎娈典粛鑳借繛缁 + + 鎵撲釜姣旀柟锛氫竴娈垫枩鐜囦负2鐨勭洿绾 + x澧炲姞1 Y澧炲姞2浣犵湅锛岃繖閲孻鑴辫妭浜嗕細涓涓嬪瓙鍦╕涓婄Щ鍔ㄤ簡2鏍笺 + 浣嗗疄闄呬笂鎴戜滑鐪 + Y澧炲姞1 X瀹為檯涓婂彧澧炲姞0.5. + 鎵浠ヤ竴娈垫洸绾匡紝浠栫殑寰厓鏋勬垚鐨勭洿绾夸笉绠℃枩鐜囧鍋忓兓锛岄兘鑳借繛缁墦鍗般 + 杩欏氨鏄负浠涔堝彇min锛坰1,s2锛夊喅瀹氱Щ鍔ㄦā寮忕殑鍘熷洜銆 + 杩欐牱鑳戒繚璇佷粎浠呭彧鍦ㄤ笂绉诲姩涓涓崟浣峣nt锛圷锛夛紝鑰宨nt锛圶锛夋槸涓嶅鍔犵殑锛屾诞鐐瑰瀷鐨刋鍙堟妸閲忕疮璁″埌涓嬩竴娆″湪鍒ゆ柇銆 + + 鏈鍚庡疄鐜帮細 + X锛孻鐢╠ouble鍌ㄥ瓨锛屼繚璇佸疄闄呭彔鍔犺兘杩炵画锛 + 鑰屽疄闄呮墦鍗帮紝鏄笉鑳借锛5,6.28锛夎繖鏍风殑娴偣鍨嬭兘鍦╟璇█涓婃墦鍗帮紝鎵浠ユ垜浠噰鐢╥nt鏁村瀷鐨刼ld_x,old_y鏉ユ壙鎺锛孻浠ヤ究浜庢墦鍗板湪灞忓箷涓娿 - 我们按照时间为循环只能在屏幕上打印一串断断续续的类抛物线的点。 - 但我们按照走一个“方向单位”,依次类叠,我们就能得到一串连续的线。 + 鎴戜滑鎸夌収鏃堕棿涓哄惊鐜彧鑳藉湪灞忓箷涓婃墦鍗颁竴涓叉柇鏂画缁殑绫绘姏鐗╃嚎鐨勭偣銆 + 浣嗘垜浠寜鐓ц蛋涓涓滄柟鍚戝崟浣嶁濓紝渚濇绫诲彔锛屾垜浠氨鑳藉緱鍒颁竴涓茶繛缁殑绾裤 - 结果实现: 由于,算法偏向不严谨,可能会出现小部分开局断节bug,但随着循环推迟,后期能100%连续!! + 缁撴灉瀹炵幇锛 鐢变簬锛岀畻娉曞亸鍚戜笉涓ヨ皑锛屽彲鑳戒細鍑虹幇灏忛儴鍒嗗紑灞鏂妭bug锛屼絾闅忕潃寰幆鎺ㄨ繜锛屽悗鏈熻兘100%杩炵画锛侊紒 - 加入人为修正 + 鍔犲叆浜轰负淇 - 经测试小范围的数据能完美打印出物理抛物线!!! + 缁忔祴璇曞皬鑼冨洿鐨勬暟鎹兘瀹岀編鎵撳嵃鍑虹墿鐞嗘姏鐗╃嚎锛侊紒锛 ------------------------------------------------------------*/ - //算法起点: + //绠楁硶璧风偣锛 - //二、当Y增加一个单位方向时 (把这个简单的放前面可以类比知道后面x那里在干嘛) + //浜屻佸綋Y澧炲姞涓涓崟浣嶆柟鍚戞椂 锛堟妸杩欎釜绠鍗曠殑鏀惧墠闈㈠彲浠ョ被姣旂煡閬撳悗闈閭i噷鍦ㄥ共鍢涳級 t2 = 1.0 / fabs(Vy); s2 = Vx * t2 + 0.5 * g * t2 * t2; - //一、当X改变一个单位方向时(考虑) - // 1/2 g*t*t + vx * t = 1 解一元二次方程(这里判断 增加后减少仍然是1 可能会有4种情况) - //就用公式解这个5*t*t + Vx t - 1= 0;(正负1) - //我这里的确复杂了,但是保险,如果能设计更好的算法就可以多试试。 + //涓銆佸綋X鏀瑰彉涓涓崟浣嶆柟鍚戞椂锛堣冭檻锛 + // 1/2 g*t*t + vx * t = 1 瑙d竴鍏冧簩娆℃柟绋嬶紙杩欓噷鍒ゆ柇 澧炲姞鍚庡噺灏戜粛鐒舵槸1 鍙兘浼氭湁4绉嶆儏鍐碉級 + //灏辩敤鍏紡瑙h繖涓5*t*t + Vx t - 1= 0;锛堟璐1锛 + //鎴戣繖閲岀殑纭鏉備簡锛屼絾鏄繚闄╋紝濡傛灉鑳借璁℃洿濂界殑绠楁硶灏卞彲浠ュ璇曡瘯銆 double temp; double x1_t1 = (-Vx + sqrt(Vx * Vx + 20)) / 10; double x2_t1 = (-Vx - sqrt(Vx * Vx + 20)) / 10; @@ -163,34 +163,34 @@ int main() else temp = 10; t1 = t1 < temp ? t1 : temp; - //这里主要就为了求一个t1 + //杩欓噷涓昏灏变负浜嗘眰涓涓猼1 s1 = t1 * Vy; - //进行择短判断 + //杩涜鎷╃煭鍒ゆ柇 if ((int)s1 == 0) flag = 1; else if ((int)s2 == 0) flag = 2; else flag = s1 < s2 ? 1 : 2; - //选择最优进行处理 + //閫夋嫨鏈浼樿繘琛屽鐞 if (flag == 1){ - X = X + Vx * t1 + 5 * t1 * t1; //等价于 X = X +- 1 (因为速度是带方向的,求出时间在反过来求1此时的1也是带正负号的就不要分类考虑了) - Y = Y + s1; //X改变1 Y理论上改变的大小。 + X = X + Vx * t1 + 5 * t1 * t1; //绛変环浜 X = X +- 1 锛堝洜涓洪熷害鏄甫鏂瑰悜鐨勶紝姹傚嚭鏃堕棿鍦ㄥ弽杩囨潵姹1姝ゆ椂鐨1涔熸槸甯︽璐熷彿鐨勫氨涓嶈鍒嗙被鑰冭檻浜嗭級 + Y = Y + s1; //X鏀瑰彉1 Y鐞嗚涓婃敼鍙樼殑澶у皬銆 Vx = Vx + g * t1; } else if (flag == 2){ - Y = Y + Vy * t2; //等价于 Y = Y +- 1 - X = X + s2; //Y改变1 X理论上改变的大小。 + Y = Y + Vy * t2; //绛変环浜 Y = Y +- 1 + X = X + s2; //Y鏀瑰彉1 X鐞嗚涓婃敼鍙樼殑澶у皬銆 Vx = Vx + g * t2; } - old_x = (int)X; //整型承接下一步的移动后面存入循环结构体数组以打印 + old_x = (int)X; //鏁村瀷鎵挎帴涓嬩竴姝ョ殑绉诲姩鍚庨潰瀛樺叆寰幆缁撴瀯浣撴暟缁勪互鎵撳嵃 old_y = (int)Y; - //算法终点 + //绠楁硶缁堢偣 //-------------------------------------------------------------------------------------------------------- - //之后是界面改变逻辑实现 - //碰墙改变方向 + //涔嬪悗鏄晫闈㈡敼鍙橀昏緫瀹炵幇 + //纰板鏀瑰彉鏂瑰悜 if (X >= width - 2 || X <= 2){ color = (color + 1) % 5; Vx = -Vx; @@ -200,19 +200,19 @@ int main() Vy = -Vy; } - //消除末尾节点 + //娑堥櫎鏈熬鑺傜偣 if (if_miss == 1){ - //map是后台数组,如果身体经过一次就++,消去一次就--直到回复原来状态就可以打印消去。防止自己吃掉自己的身体 + //map鏄悗鍙版暟缁勶紝濡傛灉韬綋缁忚繃涓娆″氨++锛屾秷鍘讳竴娆″氨--鐩村埌鍥炲鍘熸潵鐘舵佸氨鍙互鎵撳嵃娑堝幓銆傞槻姝㈣嚜宸卞悆鎺夎嚜宸辩殑韬綋 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); gotoxy(s[step].y, s[step].x); map[s[step].x][s[step].y]--; - if (map[s[step].x][s[step].y] == ' ') //防止自己吃自己 + if (map[s[step].x][s[step].y] == ' ') //闃叉鑷繁鍚冭嚜宸 printf(" "); } s[step].x = old_x; s[step].y = old_y; - if (map[s[step].x][s[step].y] == '*') //(贪吃蛇模式)吃到食物身体增长 + if (map[s[step].x][s[step].y] == '*') //锛堣椽鍚冭泧妯″紡锛夊悆鍒伴鐗╄韩浣撳闀 { map[s[step].x][s[step].y] = ' '; max++; @@ -221,24 +221,24 @@ int main() printf("len:%5d", max); } - //决定身体颜色 + //鍐冲畾韬綋棰滆壊 switch (color) { case 0: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 60); - break; //蓝色 + break; //钃濊壊 case 1: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 70); - break; //红色 + break; //绾㈣壊 case 2: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 40); - break; //绿色 + break; //缁胯壊 case 3: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 30); - break; //深蓝色 + break; //娣辫摑鑹 case 4: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 80); - break; //紫色 + break; //绱壊 } gotoxy(s[step].y, s[step].x); map[s[step].x][s[step].y]++; @@ -246,9 +246,9 @@ int main() step++; if (step >= max) { - if_miss = 1; //如果长度开始大于最长长度就要开始从末尾消除尾节点了 + if_miss = 1; //濡傛灉闀垮害寮濮嬪ぇ浜庢渶闀块暱搴﹀氨瑕佸紑濮嬩粠鏈熬娑堥櫎灏捐妭鐐逛簡 } step = step % max; - Sleep(10); //把10改成竖直坐标关于高度的公式可以模拟下坠的时候速度 + Sleep(10); //鎶10鏀规垚绔栫洿鍧愭爣鍏充簬楂樺害鐨勫叕寮忓彲浠ユā鎷熶笅鍧犵殑鏃跺欓熷害 } } \ No newline at end of file diff --git "a/\346\216\230\345\234\260\346\261\202\345\215\207/garvity.txt" "b/\346\216\230\345\234\260\346\261\202\345\215\207/garvity.txt" index 8ccec74..9473ff5 100644 --- "a/\346\216\230\345\234\260\346\261\202\345\215\207/garvity.txt" +++ "b/\346\216\230\345\234\260\346\261\202\345\215\207/garvity.txt" @@ -1,18 +1,18 @@ -/*-------------------------------------。 -程序名字:掘地求升(C语言版) -程序作者:CTGU_LLZ -完成时间:2020/1/15-2020/1/26 +/*-------------------------------------銆 +绋嬪簭鍚嶅瓧锛氭帢鍦版眰鍗囷紙C璇█鐗堬級 +绋嬪簭浣滆咃細CTGU_LLZ +瀹屾垚鏃堕棿锛2020/1/15-2020/1/26 --------------------------------------*/ -// goto xy 对应 xy 而map对应map【y】[x] -#include //用于getch(); +// goto xy 瀵瑰簲 xy 鑰宮ap瀵瑰簲map銆恲銆慬x] +#include //鐢ㄤ簬getch锛堬級锛 #include #include #include -#define people 'M' //光标加M有点像一只小兔子 +#define people 'M' //鍏夋爣鍔燤鏈夌偣鍍忎竴鍙皬鍏斿瓙 #define link '*' #define hammer 'O' -#define load_speed 10 // 0-10 飞速 30-50等待速度 -void gotoxy(int x, int y) //坐标函数 +#define load_speed 10 // 0-10 椋為 30-50绛夊緟閫熷害 +void gotoxy(int x, int y) //鍧愭爣鍑芥暟 { HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); COORD pos; @@ -20,7 +20,7 @@ void gotoxy(int x, int y) // pos.Y = y; SetConsoleCursorPosition(handle, pos); } -struct pass_information //关卡结构体 包括出生点 下一关传送点 地图 +struct pass_information //鍏冲崱缁撴瀯浣 鍖呮嫭鍑虹敓鐐 涓嬩竴鍏充紶閫佺偣 鍦板浘 { int start_x; int start_y; @@ -32,441 +32,441 @@ struct pass_information // 6, 56, 13, - {{"███████████████████████████████"}, - {"■向上跳的同时切换方向■Tip: 按键R重新开始本关卡 ■"}, - {"■是游戏的最重要的技巧■ 按键F复位防止卡死 ■"}, - {"■翻越一定是向上起手 ■ 按键N next下一关(设置开启) ■"}, - {"■ ■ 按键B back上一关(设置开启) ■"}, - {"■ ■ 按键P 返回菜单 ■"}, - {"■ ■ 触碰⊙坠落 ⊙为关卡衔接 ■"}, - {"■ ■ 触碰 进入下一关 " - "■"}, - {"■ ■■■■■■■■■■■■■■■■■■■■"}, - {"■ ■"}, - {"■ ■"}, - {"■■■■■ ■"}, - {"■ ■■■ ■■■ ■■■ ■"}, - {"■ ■"}, - {"■ ■"}, - {"■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■"}, - {"■基本操作方式:1.数字键盘对应锤子方向 ■"}, - {"■ 2.空格/按键5 对应拉锤子进行相应运动 ■"}, - {"■ 3.左下角□->■就是此时锤子固定可以运动 ■"}, - {"■ 4.翻越方向是固定的 ■"}, - {"■状态栏 5.锤子是可以穿越墙体的 ■"}, - {"■↓↓↓ 6.向上跳的瞬间切换锤子方向可以灵活运动 ■"}, - {"■=〓|=〓=〓〓=〓〓=〓=〓〓|〓=〓〓=〓=〓〓〓=〓〓=〓=〓〓〓■"}, - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}, - {"▓⊙⊙⊙▓ ▓"}, - {"▓⊙□⊙▓人生的本质在于运动,安谧宁静就是死亡。——帕斯卡 ▓"}, - {"▓⊙⊙⊙▓ ▓"}, - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}}}, + {{"鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻"}, + {"鈻犲悜涓婅烦鐨勫悓鏃跺垏鎹㈡柟鍚戔枲Tip锛 鎸夐敭R閲嶆柊寮濮嬫湰鍏冲崱 鈻"}, + {"鈻犳槸娓告垙鐨勬渶閲嶈鐨勬妧宸р枲 鎸夐敭F澶嶄綅闃叉鍗℃ 鈻"}, + {"鈻犵炕瓒婁竴瀹氭槸鍚戜笂璧锋墜 鈻 鎸夐敭N next涓嬩竴鍏筹紙璁剧疆寮鍚級 鈻"}, + {"鈻 鈻 鎸夐敭B back涓婁竴鍏筹紙璁剧疆寮鍚級 鈻"}, + {"鈻 鈻 鎸夐敭P 杩斿洖鑿滃崟 鈻"}, + {"鈻 鈻 瑙︾鈯欏潬钀 鈯欎负鍏冲崱琛旀帴 鈻"}, + {"鈻 鈻 瑙︾ 杩涘叆涓嬩竴鍏 " + "鈻"}, + {"鈻 鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲"}, + {"鈻 鈻"}, + {"鈻 鈻"}, + {"鈻犫枲鈻犫枲鈻 鈻"}, + {"鈻 鈻犫枲鈻 鈻犫枲鈻 鈻犫枲鈻 鈻"}, + {"鈻 鈻"}, + {"鈻 鈻"}, + {"鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻"}, + {"鈻犲熀鏈搷浣滄柟寮忥細1.鏁板瓧閿洏瀵瑰簲閿ゅ瓙鏂瑰悜 鈻"}, + {"鈻 2.绌烘牸/鎸夐敭5 瀵瑰簲鎷夐敜瀛愯繘琛岀浉搴旇繍鍔 鈻"}, + {"鈻 3.宸︿笅瑙掆枴->鈻犲氨鏄鏃堕敜瀛愬浐瀹氬彲浠ヨ繍鍔 鈻"}, + {"鈻 4.缈昏秺鏂瑰悜鏄浐瀹氱殑 鈻"}, + {"鈻犵姸鎬佹爮 5.閿ゅ瓙鏄彲浠ョ┛瓒婂浣撶殑 鈻"}, + {"鈻犫啌鈫撯啌 6.鍚戜笂璺崇殑鐬棿鍒囨崲閿ゅ瓙鏂瑰悜鍙互鐏垫椿杩愬姩 鈻"}, + {"鈻=銆搢=銆=銆撱=銆撱=銆=銆撱搢銆=銆撱=銆=銆撱撱=銆撱=銆=銆撱撱撯枲"}, + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}, + {"鈻撯姍鈯欌姍鈻 鈻"}, + {"鈻撯姍鈻♀姍鈻撲汉鐢熺殑鏈川鍦ㄤ簬杩愬姩锛屽畨璋у畞闈欏氨鏄浜°傗斺斿笗鏂崱 鈻"}, + {"鈻撯姍鈯欌姍鈻 鈻"}, + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}}}, {11, 19, 58, 6, - {{"■⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙■"}, // 0 //pass1 - {"■ ■"}, // 1 - {"■ ■"}, // 2 - {"■ ■"}, // 3 - {"■ ■"}, // 4 - {"■ ■"}, // 5 - {"■ ■"}, // 6 - {"■ =〓=〓=〓=■"}, // 7 - {"■ =〓〓〓=〓■"}, // 8 - {"■ \\〓〓=〓〓〓=〓■"}, // 9 - {"■ 〓=〓〓〓=〓〓■"}, // 10 - {"■ 〓〓=〓=〓■"}, // 11 - {"■ # 〓=〓=〓=〓=■"}, // 12 - {"■ ___ ===#- 〓〓= = 〓=〓=■"}, // 13 - {"■ _// # =〓=〓=〓=■"}, // 14 - {"■| #/// #__/ 〓〓=〓=〓=〓=■"}, // 15 - {"■| # # 〓〓=〓=〓=■"}, // 16 - {"■| #/ \\# 〓〓=〓=〓 ■"}, // 17 - {"■| # # 〓〓=〓=〓=■"}, // 18 - {"■| # /==== # 〓〓=〓=〓=〓=■"}, // 19 - {"■=〓〓=〓=〓〓〓=〓〓=〓=〓=〓〓=〓=〓=〓〓=〓=〓〓〓=〓〓=■"}, // 20 - {"■〓〓〓=〓=〓〓=〓=〓=〓〓=〓=〓=〓〓=〓=〓〓==〓〓〓=〓〓=■"}, // 21 - {"■⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙游戏场景■"}, // 22 - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}, - {"▓⊙⊙⊙▓Pass:1 ▓ 欢迎回家 ▓"}, - {"▓⊙□⊙▓新手村 ▓ 有希望在的地方,痛苦也成欢乐。 ▓"}, - {"▓⊙⊙⊙▓梦的起点 ▓认识错误是拯救自己的第一步 —伊壁鸠鲁 ▓"}, - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}}}, + {{"鈻犫姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈻"}, // 0 //pass1 + {"鈻 鈻"}, // 1 + {"鈻 鈻"}, // 2 + {"鈻 鈻"}, // 3 + {"鈻 鈻"}, // 4 + {"鈻 鈻"}, // 5 + {"鈻 鈻"}, // 6 + {"鈻 =銆=銆=銆=鈻"}, // 7 + {"鈻 =銆撱撱=銆撯枲"}, // 8 + {"鈻 \\銆撱=銆撱撱=銆撯枲"}, // 9 + {"鈻 銆=銆撱撱=銆撱撯枲"}, // 10 + {"鈻 銆撱=銆=銆撯枲"}, // 11 + {"鈻 # 銆=銆=銆=銆=鈻"}, // 12 + {"鈻 ___ ===#- 銆撱= = 銆=銆=鈻"}, // 13 + {"鈻 _// # =銆=銆=銆=鈻"}, // 14 + {"鈻爘 #/// #__/ 銆撱=銆=銆=銆=鈻"}, // 15 + {"鈻爘 # # 銆撱=銆=銆=鈻"}, // 16 + {"鈻爘 #/ \\# 銆撱=銆=銆 鈻"}, // 17 + {"鈻爘 # # 銆撱=銆=銆=鈻"}, // 18 + {"鈻爘 # /==== # 銆撱=銆=銆=銆=鈻"}, // 19 + {"鈻=銆撱=銆=銆撱撱=銆撱=銆=銆=銆撱=銆=銆=銆撱=銆=銆撱撱=銆撱=鈻"}, // 20 + {"鈻犮撱撱=銆=銆撱=銆=銆=銆撱=銆=銆=銆撱=銆=銆撱==銆撱撱=銆撱=鈻"}, // 21 + {"鈻犫姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍娓告垙鍦烘櫙鈻"}, // 22 + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}, + {"鈻撯姍鈯欌姍鈻揚ass锛1 鈻 娆㈣繋鍥炲 鈻"}, + {"鈻撯姍鈻♀姍鈻撴柊鎵嬫潙 鈻 鏈夊笇鏈涘湪鐨勫湴鏂癸紝鐥涜嫤涔熸垚娆箰銆 鈻"}, + {"鈻撯姍鈯欌姍鈻撴ⅵ鐨勮捣鐐 鈻撹璇嗛敊璇槸鎷晳鑷繁鐨勭涓姝 鈥斾紛澹侀笭椴 鈻"}, + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}}}, {43, 11, 16, 1, - {{"■⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙■"}, // 0pass 4 - {"■ || ■■■■■■■■ " - "■"}, // 1 - {"■ ########### || #### ■"}, // 2 - {"■ |# ################________||________ #### ■"}, // 3 - {"■ | ### ##■# ■"}, // 4 - {"■ _ | ### □ ##■# ■"}, // 5 - {"■ | ### | ##### ■"}, // 6 - {"■ ####### #| # ■"}, // 7 - {"■ |#| # ■"}, // 8 - {"■ #| # ■"}, // 9 - {"■ | #|___# ■"}, // 10 - {"■ ###### ■"}, // 11 - {"■ | | |#| # ■"}, // 12 - {"■ #| # ■"}, // 13 - {"■ #□ # ■"}, // 14 - {"■ #□__# ■"}, // 15 - {"■ ==###### ■"}, // 16 - {"■ #| # ■"}, // 17 - {"■ #| # ■"}, // 18 - {"■ #| # ■"}, // 19 - {"■ ■#|___# ■"}, // 20 - {"■ 〓=〓=〓〓=〓〓=〓= =〓 ■"}, // 21 - {"■⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙游戏场景■"}, // 22 - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}, - {"▓⊙⊙⊙▓Pass:2 ▓ ▓"}, - {"▓⊙□⊙▓建筑工地▓ 唯有理智最为可贵。 ▓"}, - {"▓⊙⊙⊙▓g = 9.8 ▓ ▓"}, - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}}}, + {{"鈻犫姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈻"}, // 0pass 4 + {"鈻 || 鈻犫枲鈻犫枲鈻犫枲鈻犫枲 " + "鈻"}, // 1 + {"鈻 ########### || #### 鈻"}, // 2 + {"鈻 |# ################________||________ #### 鈻"}, // 3 + {"鈻 | ### ##鈻# 鈻"}, // 4 + {"鈻 _ | ### 鈻 ##鈻# 鈻"}, // 5 + {"鈻 | ### | ##### 鈻"}, // 6 + {"鈻 ####### #| # 鈻"}, // 7 + {"鈻 |#| # 鈻"}, // 8 + {"鈻 #| # 鈻"}, // 9 + {"鈻 | #|___# 鈻"}, // 10 + {"鈻 ###### 鈻"}, // 11 + {"鈻 | | |#| # 鈻"}, // 12 + {"鈻 #| # 鈻"}, // 13 + {"鈻 #鈻 # 鈻"}, // 14 + {"鈻 #鈻_# 鈻"}, // 15 + {"鈻 ==###### 鈻"}, // 16 + {"鈻 #| # 鈻"}, // 17 + {"鈻 #| # 鈻"}, // 18 + {"鈻 #| # 鈻"}, // 19 + {"鈻 鈻#|___# 鈻"}, // 20 + {"鈻 銆=銆=銆撱=銆撱=銆= =銆 鈻"}, // 21 + {"鈻犫姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍娓告垙鍦烘櫙鈻"}, // 22 + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}, + {"鈻撯姍鈯欌姍鈻揚ass锛2 鈻 鈻"}, + {"鈻撯姍鈻♀姍鈻撳缓绛戝伐鍦扳枔 鍞湁鐞嗘櫤鏈涓哄彲璐点 鈻"}, + {"鈻撯姍鈯欌姍鈻揼 = 9.8 鈻 鈻"}, + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}}}, {29, 17, 57, 2, {// ok - {"■⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙■"}, - {"■ ■"}, - {"■ ■"}, - {"■ ■"}, - {"■ ■■■"}, - {"■ ■■■■"}, - {"■ =■== ■"}, - {"■ ■== ■"}, - {"■ __ 〓〓 ■==■"}, - {"■ _| |_ || ■=■"}, - {"■ ===■=■ =■=■=■= ==■■"}, - {"■ = =■ =■== =■■"}, - {"■ = =■== =■■"}, - {"■ = =■=■■■■■ ==■■"}, - {"■ =■=■=■■=■■■■=■=■"}, - {"■ ■=■=■■■=■=■■=■■"}, - {"■ =■=■=■■■■=■=■ ==■■"}, - {"■ ■■■■■=■=■=■■"}, - {"■ ___________|N|________■=■=■■ ■■■■ ■"}, - {"■ _| |___________________|_■■■■■■■■■■■"}, - {"■ _| □ |____________________|_ ■■■■■■■■■"}, - {"■ | □□ |___________________| ■■■■■■■■"}, - {"■⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙游戏场景■"}, - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}, - {"▓⊙⊙⊙▓Pass:3 ▓ ▓"}, - {"▓⊙□⊙▓新的起点▓ 没有物体,只有运动。——伯格森 ▓"}, - {"▓⊙⊙⊙▓帽子崖 ▓ ▓"}, - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}}}, + {"鈻犫姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈻"}, + {"鈻 鈻"}, + {"鈻 鈻"}, + {"鈻 鈻"}, + {"鈻 鈻犫枲鈻"}, + {"鈻 鈻犫枲鈻犫枲"}, + {"鈻 =鈻== 鈻"}, + {"鈻 鈻== 鈻"}, + {"鈻 __ 銆撱 鈻==鈻"}, + {"鈻 _| |_ || 鈻=鈻"}, + {"鈻 ===鈻=鈻 =鈻=鈻=鈻= ==鈻犫枲"}, + {"鈻 = =鈻 =鈻== =鈻犫枲"}, + {"鈻 = =鈻== =鈻犫枲"}, + {"鈻 = =鈻=鈻犫枲鈻犫枲鈻 ==鈻犫枲"}, + {"鈻 =鈻=鈻=鈻犫枲=鈻犫枲鈻犫枲=鈻=鈻"}, + {"鈻 鈻=鈻=鈻犫枲鈻=鈻=鈻犫枲=鈻犫枲"}, + {"鈻 =鈻=鈻=鈻犫枲鈻犫枲=鈻=鈻 ==鈻犫枲"}, + {"鈻 鈻犫枲鈻犫枲鈻=鈻=鈻=鈻犫枲"}, + {"鈻 ___________|N|________鈻=鈻=鈻犫枲 鈻犫枲鈻犫枲 鈻"}, + {"鈻 _| |___________________|_鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻"}, + {"鈻 _| 鈻 |____________________|_ 鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻"}, + {"鈻 | 鈻♀枴 |___________________| 鈻犫枲鈻犫枲鈻犫枲鈻犫枲"}, + {"鈻犫姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍娓告垙鍦烘櫙鈻"}, + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}, + {"鈻撯姍鈯欌姍鈻揚ass锛3 鈻 鈻"}, + {"鈻撯姍鈻♀姍鈻撴柊鐨勮捣鐐光枔 娌℃湁鐗╀綋锛屽彧鏈夎繍鍔ㄣ傗斺斾集鏍兼. 鈻"}, + {"鈻撯姍鈯欌姍鈻撳附瀛愬礀 鈻 鈻"}, + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}}}, {25, 5, 58, 2, - {{"■⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙■"}, // 0 //pass 2 - {"■ ■"}, // 1 - {"■ ■"}, // 2 - {"■ 〓〓〓=〓=〓=〓 〓■"}, // 3 - {"■ 〓 〓 〓=〓=〓■"}, // 4 - {"■ 〓 〓 〓 〓 ■"}, // 5 - {"■ 〓 〓 〓〓〓=〓■"}, // 6 - {"■ 〓=〓=〓〓〓=〓■"}, // 7 - {"■ 〓〓=〓〓=〓=〓〓〓= ■"}, // 8 - {"■ 〓〓=〓=〓〓〓=〓 ■"}, // 9 - {"■ 〓=〓〓=〓=〓〓■"}, // 10 - {"■ 〓〓〓 =〓=〓〓〓=〓〓=■"}, // 11 - {"■ 〓〓〓 〓〓=〓=〓〓〓=〓 ■"}, // 12 - {"■ 〓 =〓〓=〓=〓〓〓=〓■"}, // 13 - {"■ =〓〓=〓=〓〓〓=〓■"}, // 14 - {"■ =〓〓=〓=〓〓〓=〓 ■"}, // 15 - {"■ 〓 =〓=〓〓=〓=〓〓〓=〓■"}, // 16 - {"■ ! =〓=〓〓=〓=〓〓〓=〓■"}, // 17 - {"■ 〓=〓〓=〓=〓〓〓=〓〓= ■"}, // 18 - {"■ =〓=〓=〓〓〓=〓〓= =〓■"}, // 19 - {"■ 〓〓〓=〓=〓=〓〓=〓=〓〓〓=〓〓=■"}, // 20 - {"■ 〓=〓=〓=〓=〓=〓〓=〓〓=〓= =〓 ■"}, // 21 - {"■⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙自创关卡■"}, // 22 - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}, - {"▓⊙⊙⊙▓Pass:4 ▓ ▓"}, - {"▓⊙□⊙▓攀登 ▓ 痛苦就是被迫离开原地。——康德 ▓"}, - {"▓⊙⊙⊙▓小心 ! ▓ ▓"}, - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}}}, + {{"鈻犫姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈻"}, // 0 //pass 2 + {"鈻 鈻"}, // 1 + {"鈻 鈻"}, // 2 + {"鈻 銆撱撱=銆=銆=銆 銆撯枲"}, // 3 + {"鈻 銆 銆 銆=銆=銆撯枲"}, // 4 + {"鈻 銆 銆 銆 銆 鈻"}, // 5 + {"鈻 銆 銆 銆撱撱=銆撯枲"}, // 6 + {"鈻 銆=銆=銆撱撱=銆撯枲"}, // 7 + {"鈻 銆撱=銆撱=銆=銆撱撱= 鈻"}, // 8 + {"鈻 銆撱=銆=銆撱撱=銆 鈻"}, // 9 + {"鈻 銆=銆撱=銆=銆撱撯枲"}, // 10 + {"鈻 銆撱撱 =銆=銆撱撱=銆撱=鈻"}, // 11 + {"鈻 銆撱撱 銆撱=銆=銆撱撱=銆 鈻"}, // 12 + {"鈻 銆 =銆撱=銆=銆撱撱=銆撯枲"}, // 13 + {"鈻 =銆撱=銆=銆撱撱=銆撯枲"}, // 14 + {"鈻 =銆撱=銆=銆撱撱=銆 鈻"}, // 15 + {"鈻 銆 =銆=銆撱=銆=銆撱撱=銆撯枲"}, // 16 + {"鈻 锛 =銆=銆撱=銆=銆撱撱=銆撯枲"}, // 17 + {"鈻 銆=銆撱=銆=銆撱撱=銆撱= 鈻"}, // 18 + {"鈻 =銆=銆=銆撱撱=銆撱= =銆撯枲"}, // 19 + {"鈻 銆撱撱=銆=銆=銆撱=銆=銆撱撱=銆撱=鈻"}, // 20 + {"鈻 銆=銆=銆=銆=銆=銆撱=銆撱=銆= =銆 鈻"}, // 21 + {"鈻犫姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鑷垱鍏冲崱鈻"}, // 22 + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}, + {"鈻撯姍鈯欌姍鈻揚ass锛4 鈻 鈻"}, + {"鈻撯姍鈻♀姍鈻撴攢鐧 鈻 鐥涜嫤灏辨槸琚揩绂诲紑鍘熷湴銆傗斺斿悍寰 鈻"}, + {"鈻撯姍鈯欌姍鈻撳皬蹇 锛 鈻 鈻"}, + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}}}, {57, 19, 41, 2, - {{"■⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙■"}, // 0 passs 3 - {"■ ■"}, // 1 - {"■ ■"}, // 2 - {"■ _ ==〓=〓== ■"}, // 3 - {"■ =====〓=〓=〓〓 〓 〓= ==■"}, // 4 - {"■ = 〓 〓 〓 ■"}, // 5 - {"■ = = 〓 〓 〓 ■"}, // 6 - {"■ = = 〓= →→〓 〓■"}, // 7 - {"■ = 〓〓=〓〓=〓=〓 ■"}, // 8 - {"■ = 〓 ■"}, // 9 - {"■ = = ■"}, // 10 - {"■ === =■"}, // 11 - {"■ 〓〓 〓〓=〓=〓〓〓=〓 ■"}, // 12 - {"■ 〓 =〓〓 == 〓= ■"}, // 13 - {"■ 〓= = 〓〓=〓■"}, // 14 - {"■ 〓= 〓=〓 ■"}, // 15 - {"■ 〓 =〓 〓〓= ■"}, // 16 - {"■ = = ■"}, // 17 - {"■ 〓=〓〓 〓= ■"}, // 18 - {"■ =〓 = ■"}, // 19 - {"■ =〓=〓=〓=〓〓〓= 〓〓= ■"}, // 20 - {"■ 〓=〓=〓〓=〓〓=〓= =〓 ■"}, // 21 - {"■⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙自创关卡■"}, // 22 - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}, - {"▓⊙⊙⊙▓Pass:5 ▓ ▓"}, - {"▓⊙□⊙▓山洞 ▓ 我正在说谎。——罗素 ▓"}, - {"▓⊙⊙⊙▓学会卡位▓ ▓"}, - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}}}, + {{"鈻犫姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈻"}, // 0 passs 3 + {"鈻 鈻"}, // 1 + {"鈻 鈻"}, // 2 + {"鈻 _ ==銆=銆== 鈻"}, // 3 + {"鈻 =====銆=銆=銆撱 銆 銆= ==鈻"}, // 4 + {"鈻 = 銆 銆 銆 鈻"}, // 5 + {"鈻 = = 銆 銆 銆 鈻"}, // 6 + {"鈻 = = 銆= 鈫掆啋銆 銆撯枲"}, // 7 + {"鈻 = 銆撱=銆撱=銆=銆 鈻"}, // 8 + {"鈻 = 銆 鈻"}, // 9 + {"鈻 = = 鈻"}, // 10 + {"鈻 === =鈻"}, // 11 + {"鈻 銆撱 銆撱=銆=銆撱撱=銆 鈻"}, // 12 + {"鈻 銆 =銆撱 == 銆= 鈻"}, // 13 + {"鈻 銆= = 銆撱=銆撯枲"}, // 14 + {"鈻 銆= 銆=銆 鈻"}, // 15 + {"鈻 銆 =銆 銆撱= 鈻"}, // 16 + {"鈻 = = 鈻"}, // 17 + {"鈻 銆=銆撱 銆= 鈻"}, // 18 + {"鈻 =銆 = 鈻"}, // 19 + {"鈻 =銆=銆=銆=銆撱撱= 銆撱= 鈻"}, // 20 + {"鈻 銆=銆=銆撱=銆撱=銆= =銆 鈻"}, // 21 + {"鈻犫姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鑷垱鍏冲崱鈻"}, // 22 + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}, + {"鈻撯姍鈯欌姍鈻揚ass锛5 鈻 鈻"}, + {"鈻撯姍鈻♀姍鈻撳北娲 鈻 鎴戞鍦ㄨ璋庛傗斺旂綏绱 鈻"}, + {"鈻撯姍鈯欌姍鈻撳浼氬崱浣嶁枔 鈻"}, + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}}}, {41, 18, 13, 3, - {{"■⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙■"}, // 0 - {"■ ■"}, // 1 - {"■ ■"}, // 2 - {"■ ■"}, // 3 - {"■ ■"}, // 4 - {"■ ⊙⊙ ⊙⊙ ■"}, // 5 - {"■ ⊙⊙= ⊙⊙ ● ● ■"}, // 6 - {"■ ■"}, // 7 - {"■ =⊙⊙= ● ■"}, // 8 - {"■ ⊙⊙ ■"}, // 9 - {"■ ■"}, // 10 - {"■ ● ■"}, // 11 - {"■ ■"}, // 12 - {"■ ■"}, // 13 - {"■ ● ■"}, // 14 - {"■ ● ■"}, // 15 - {"■ ■"}, // 16 - {"■ ● ■"}, // 17 - {"■ ■"}, // 18 - {"■ ■■■■ ■"}, // 19 - {"■ | | ■"}, // 20 - {"■ | | ■"}, // 21 - {"■⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙■"}, // 22 - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}, - {"▓⊙⊙⊙▓Pass:6 ▓ ▓"}, - {"▓⊙□⊙▓大雪球 ▓ 只要有信心,人永远不会挫败。 ▓"}, - {"▓⊙⊙⊙▓ ▓ ▓"}, - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}}}, + {{"鈻犫姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈻"}, // 0 + {"鈻 鈻"}, // 1 + {"鈻 鈻"}, // 2 + {"鈻 鈻"}, // 3 + {"鈻 鈻"}, // 4 + {"鈻 鈯欌姍 鈯欌姍 鈻"}, // 5 + {"鈻 鈯欌姍= 鈯欌姍 鈼 鈼 鈻"}, // 6 + {"鈻 鈻"}, // 7 + {"鈻 =鈯欌姍= 鈼 鈻"}, // 8 + {"鈻 鈯欌姍 鈻"}, // 9 + {"鈻 鈻"}, // 10 + {"鈻 鈼 鈻"}, // 11 + {"鈻 鈻"}, // 12 + {"鈻 鈻"}, // 13 + {"鈻 鈼 鈻"}, // 14 + {"鈻 鈼 鈻"}, // 15 + {"鈻 鈻"}, // 16 + {"鈻 鈼 鈻"}, // 17 + {"鈻 鈻"}, // 18 + {"鈻 鈻犫枲鈻犫枲 鈻"}, // 19 + {"鈻 | | 鈻"}, // 20 + {"鈻 | | 鈻"}, // 21 + {"鈻犫姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈻"}, // 22 + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}, + {"鈻撯姍鈯欌姍鈻揚ass锛6 鈻 鈻"}, + {"鈻撯姍鈻♀姍鈻撳ぇ闆悆 鈻 鍙鏈変俊蹇冿紝浜烘案杩滀笉浼氭尗璐ャ 鈻"}, + {"鈻撯姍鈯欌姍鈻 鈻 鈻"}, + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}}}, {23, 17, 54, 3, - {{"■⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙■"}, // 0 - {"■ ■"}, // 1 - {"■ ■"}, // 2 - {"■ ■"}, // 3 - {"■ ■"}, // 4 - {"■ _________ ■"}, // 5 - {"■ | | | =〓=〓=〓=〓=〓=〓〓=〓=〓=〓=■"}, // 6 - {"■ = 〓〓 | | =〓〓=〓=〓=〓=〓= 〓 〓= 〓=〓=■"}, // 7 - {"■ = 〓〓 = | 〓〓=〓〓=〓=〓=〓=〓=〓〓=〓=〓=〓=■"}, // 8 - {"■ 〓=〓=〓 〓= | | =〓〓=〓=〓〓〓=〓〓〓=〓=〓〓■"}, // 9 - {"■ Do Not Touch 〓== | =〓=〓=〓=〓〓〓=〓=〓=〓■"}, // 10 - {"■ The Snake 〓=〓 | =〓〓=〓=〓=〓=〓 =〓■"}, // 11 - {"■ 〓 ↓↓〓〓 | 〓〓==〓〓=〓=〓〓=〓■"}, // 12 - {"■ | | 〓〓=〓=〓〓〓=〓〓=■"}, // 13 - {"■ | ___/ ^ =〓〓=〓=〓 =〓 =■"}, // 14 - {"■ | ____/ |_| ■"}, // 15 - {"■ / ■"}, // 16 - {"■ | ■"}, // 17 - {"■ | =〓=〓〓=〓=〓=〓=〓= ■"}, // 18 - {"■ | 〓 〓== =〓 〓= =〓 ■"}, // 19 - {"■ | = 〓 = 〓〓 = =〓 ■"}, // 20 - {"■ | == =〓〓=〓〓= ■"}, // 21 - {"■⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙■"}, // 22 - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}, - {"▓⊙⊙⊙▓Pass:7 ▓ ▓"}, - {"▓⊙□⊙▓快乐桶 ▓ 人可以犯错,但是不可犯同一个错。 ▓"}, - {"▓⊙⊙⊙▓快乐玩蛇▓ ▓"}, - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}}}, + {{"鈻犫姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈻"}, // 0 + {"鈻 鈻"}, // 1 + {"鈻 鈻"}, // 2 + {"鈻 鈻"}, // 3 + {"鈻 鈻"}, // 4 + {"鈻 _________ 鈻"}, // 5 + {"鈻 | | | =銆=銆=銆=銆=銆=銆撱=銆=銆=銆=鈻"}, // 6 + {"鈻 = 銆撱 | | =銆撱=銆=銆=銆=銆= 銆 銆= 銆=銆=鈻"}, // 7 + {"鈻 = 銆撱 = | 銆撱=銆撱=銆=銆=銆=銆=銆撱=銆=銆=銆=鈻"}, // 8 + {"鈻 銆=銆=銆 銆= | | =銆撱=銆=銆撱撱=銆撱撱=銆=銆撱撯枲"}, // 9 + {"鈻 Do Not Touch 銆== | =銆=銆=銆=銆撱撱=銆=銆=銆撯枲"}, // 10 + {"鈻 The Snake 銆=銆 | =銆撱=銆=銆=銆=銆 =銆撯枲"}, // 11 + {"鈻 銆 鈫撯啌銆撱 | 銆撱==銆撱=銆=銆撱=銆撯枲"}, // 12 + {"鈻 | | 銆撱=銆=銆撱撱=銆撱=鈻"}, // 13 + {"鈻 | ___/ ^ =銆撱=銆=銆 =銆 =鈻"}, // 14 + {"鈻 | ____/ |_| 鈻"}, // 15 + {"鈻 / 鈻"}, // 16 + {"鈻 | 鈻"}, // 17 + {"鈻 | =銆=銆撱=銆=銆=銆=銆= 鈻"}, // 18 + {"鈻 | 銆 銆== =銆 銆= =銆 鈻"}, // 19 + {"鈻 | = 銆 = 銆撱 = =銆 鈻"}, // 20 + {"鈻 | == =銆撱=銆撱= 鈻"}, // 21 + {"鈻犫姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈻"}, // 22 + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}, + {"鈻撯姍鈯欌姍鈻揚ass锛7 鈻 鈻"}, + {"鈻撯姍鈻♀姍鈻撳揩涔愭《 鈻 浜哄彲浠ョ姱閿欙紝浣嗘槸涓嶅彲鐘悓涓涓敊銆 鈻"}, + {"鈻撯姍鈯欌姍鈻撳揩涔愮帺铔団枔 鈻"}, + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}}}, {3, 16, 38, 2, - {{"■⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙■"}, // 0 - {"■ || ■"}, // 1 - {"■ || ■"}, // 2 - {"■ -|| ■"}, // 3 - {"■ || ■"}, // 4 - {"■ _||_ ■"}, // 5 - {"■ \\| ◇|| ■"}, // 6 - {"■ | ◆ | ■"}, // 7 - {"■ || ◇|| ■"}, // 8 - {"■ | ◆ | ■"}, // 9 - {"■ | ◇|| ■"}, // 10 - {"■ _| ◆ | ■"}, // 11 - {"■ | ◇|| ■"}, // 12 - {"■ _____|_◆_|_____ ■"}, // 13 - {"■ __|________________|__ ■"}, // 14 - {"■ | | | | | | | ■"}, // 15 - {"■ | | | | | | | ■"}, // 16 - {"■ =〓=〓=〓〓=〓=〓 =〓==〓 =〓=〓=■"}, // 17 - {"■ =〓=〓=〓〓=〓=〓=〓==〓 =〓=〓=〓■"}, // 18 - {"■ =〓=〓=〓〓=〓=〓=〓==〓〓=〓=〓=〓■"}, // 19 - {"■ 〓 = = =〓=〓=〓=〓=〓〓=〓=〓=〓==〓〓=〓=〓=〓=■"}, // 20 - {"■ = = 〓=〓=〓=〓=〓〓=〓=〓=〓==〓〓=〓=〓=〓=■"}, // 21 - {"■⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙■"}, // 22 - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}, - {"▓⊙⊙⊙▓Pass:8 ▓ ▓"}, - {"▓⊙□⊙▓最终章 ▓ 仰望星空,成功就在眼前 ▓"}, - {"▓⊙⊙⊙▓通天塔 ▓ ▓"}, - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}}}, + {{"鈻犫姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈻"}, // 0 + {"鈻 || 鈻"}, // 1 + {"鈻 || 鈻"}, // 2 + {"鈻 -|| 鈻"}, // 3 + {"鈻 || 鈻"}, // 4 + {"鈻 _||_ 鈻"}, // 5 + {"鈻 \\| 鈼噟| 鈻"}, // 6 + {"鈻 | 鈼 | 鈻"}, // 7 + {"鈻 || 鈼噟| 鈻"}, // 8 + {"鈻 | 鈼 | 鈻"}, // 9 + {"鈻 | 鈼噟| 鈻"}, // 10 + {"鈻 _| 鈼 | 鈻"}, // 11 + {"鈻 | 鈼噟| 鈻"}, // 12 + {"鈻 _____|_鈼哶|_____ 鈻"}, // 13 + {"鈻 __|________________|__ 鈻"}, // 14 + {"鈻 | | | | | | | 鈻"}, // 15 + {"鈻 | | | | | | | 鈻"}, // 16 + {"鈻 =銆=銆=銆撱=銆=銆 =銆==銆 =銆=銆=鈻"}, // 17 + {"鈻 =銆=銆=銆撱=銆=銆=銆==銆 =銆=銆=銆撯枲"}, // 18 + {"鈻 =銆=銆=銆撱=銆=銆=銆==銆撱=銆=銆=銆撯枲"}, // 19 + {"鈻 銆 = = =銆=銆=銆=銆=銆撱=銆=銆=銆==銆撱=銆=銆=銆=鈻"}, // 20 + {"鈻 = = 銆=銆=銆=銆=銆撱=銆=銆=銆==銆撱=銆=銆=銆=鈻"}, // 21 + {"鈻犫姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈻"}, // 22 + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}, + {"鈻撯姍鈯欌姍鈻揚ass锛8 鈻 鈻"}, + {"鈻撯姍鈻♀姍鈻撴渶缁堢珷 鈻 浠版湜鏄熺┖锛屾垚鍔熷氨鍦ㄧ溂鍓 鈻"}, + {"鈻撯姍鈯欌姍鈻撻氬ぉ濉 鈻 鈻"}, + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}}}, {3, 6, 1, 1, - {{"■⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙⊙■"}, // 0 - {"■回家 ■ end 恭喜顺利通关!!!! end ■"}, // 1 - {"■■■■■ 然而这破游戏并没有结局,Bennett Foddy只能选择回家■"}, // 2 - {"■■■■■ 后记: ■"}, // 3 - {"■ ■ 写这个游戏几乎用上了我大一上学的所有技巧 ■"}, // 4 - {"■ ■ ■"}, // 5 - {"■ ||■■ 相当于一个十分大的功能整合程序 ■"}, // 6 - {"■ || ■"}, // 7 - {"■ | 游戏里许多小细节的实现都是一个大程序 ■"}, // 8 - {"■ | ■"}, // 9 - {"■ | 但游戏重点还是游戏内容 ■"}, // 10 - {"■ | ■"}, // 11 - {"■ | 前面花费太多时间实现基本功能以至于内容有点赶 ■"}, // 12 - {"■ | ■"}, // 13 - {"■ | 最重要的是为了写这个,我被正版游戏虐到吐了 ■"}, // 14 - {"■ | ■"}, // 15 - {"■ | 为了构思关卡去玩正版,直接心态爆炸 ■"}, // 16 - {"■ | ■"}, // 17 - {"■ | 很少用时间去设置导致游戏内容效果不是太完美 ■"}, // 18 - {"■ | ■"}, // 19 - {"■ |〓 但框架写的真的舒服,感觉可以自己控制任意模块 =■"}, // 20 - {"■ | = =■"}, // 21 - {"■⊙⊙⊙⊙⊙⊙总之收获很大,2020加油 ⊙■"}, // 22 - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}, - {"▓⊙⊙⊙▓Pass:o ▓ ▓"}, - {"▓⊙□⊙▓ END ▓ 有理想在的地方,地狱就是天堂。 ▓"}, - {"▓⊙⊙⊙▓ 回家 ▓ ▓"}, - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}}}, + {{"鈻犫姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈯欌姍鈻"}, // 0 + {"鈻犲洖瀹 鈻 end 鎭枩椤哄埄閫氬叧锛侊紒锛侊紒 end 鈻"}, // 1 + {"鈻犫枲鈻犫枲鈻 鐒惰岃繖鐮存父鎴忓苟娌℃湁缁撳眬锛孊ennett Foddy鍙兘閫夋嫨鍥炲鈻"}, // 2 + {"鈻犫枲鈻犫枲鈻 鍚庤锛 鈻"}, // 3 + {"鈻 鈻 鍐欒繖涓父鎴忓嚑涔庣敤涓婁簡鎴戝ぇ涓涓婂鐨勬墍鏈夋妧宸 鈻"}, // 4 + {"鈻 鈻 鈻"}, // 5 + {"鈻 ||鈻犫枲 鐩稿綋浜庝竴涓崄鍒嗗ぇ鐨勫姛鑳芥暣鍚堢▼搴 鈻"}, // 6 + {"鈻 || 鈻"}, // 7 + {"鈻 | 娓告垙閲岃澶氬皬缁嗚妭鐨勫疄鐜伴兘鏄竴涓ぇ绋嬪簭 鈻"}, // 8 + {"鈻 | 鈻"}, // 9 + {"鈻 | 浣嗘父鎴忛噸鐐硅繕鏄父鎴忓唴瀹 鈻"}, // 10 + {"鈻 | 鈻"}, // 11 + {"鈻 | 鍓嶉潰鑺辫垂澶鏃堕棿瀹炵幇鍩烘湰鍔熻兘浠ヨ嚦浜庡唴瀹规湁鐐硅刀 鈻"}, // 12 + {"鈻 | 鈻"}, // 13 + {"鈻 | 鏈閲嶈鐨勬槸涓轰簡鍐欒繖涓紝鎴戣姝g増娓告垙铏愬埌鍚愪簡 鈻"}, // 14 + {"鈻 | 鈻"}, // 15 + {"鈻 | 涓轰簡鏋勬濆叧鍗″幓鐜╂鐗堬紝鐩存帴蹇冩佺垎鐐 鈻"}, // 16 + {"鈻 | 鈻"}, // 17 + {"鈻 | 寰堝皯鐢ㄦ椂闂村幓璁剧疆瀵艰嚧娓告垙鍐呭鏁堟灉涓嶆槸澶畬缇 鈻"}, // 18 + {"鈻 | 鈻"}, // 19 + {"鈻 |銆 浣嗘鏋跺啓鐨勭湡鐨勮垝鏈嶏紝鎰熻鍙互鑷繁鎺у埗浠绘剰妯″潡 =鈻"}, // 20 + {"鈻 | = =鈻"}, // 21 + {"鈻犫姍鈯欌姍鈯欌姍鈯欐讳箣鏀惰幏寰堝ぇ锛2020鍔犳补 鈯欌枲"}, // 22 + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}, + {"鈻撯姍鈯欌姍鈻揚ass锛歰 鈻 鈻"}, + {"鈻撯姍鈻♀姍鈻 END 鈻 鏈夌悊鎯冲湪鐨勫湴鏂癸紝鍦扮嫳灏辨槸澶╁爞銆 鈻"}, + {"鈻撯姍鈯欌姍鈻 鍥炲 鈻 鈻"}, + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}}}, }; char menu_message[10] [200] = { - {"┏---------┓"}, {"┗---------┚"}, {"| ◇新游戏 |"}, {"| ◇继续 |"}, {"| ◇设定 |"}, {"| ◇更多 |"}, {"| ◇退出 |"} /*6 37 49*/ /* 27 7 */}; + {"鈹---------鈹"}, {"鈹---------鈹"}, {"| 鈼囨柊娓告垙 |"}, {"| 鈼囩户缁 |"}, {"| 鈼囪瀹 |"}, {"| 鈼囨洿澶 |"}, {"| 鈼囬鍑 |"} /*6 37 49*/ /* 27 7 */}; char loading[200][800] = { - {"███████████████████████████████"}, - {"█ █"}, - {"█ ■■ Getting Over It with Bennett Foddy ■■ █"}, - {"█ █"}, - {"█ ■■ ▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽ ■■ █"}, - {"█ ■■ ⊙程序名字: 掘地求升 ⊙ ■■ █"}, - {"█ ■■ ⊙ ⊙ ■■ █"}, - {"█ ■■ ⊙版本信息: o.o.o ⊙ ■■ █"}, - {"█ ■■ ⊙ ⊙ ■■ █"}, - {"█ ■■ ⊙程序作者: 404name ⊙ ■■ █"}, - {"█ ■■ △△△△△△△△△△△△△△△△△△ ■■ █"}, // 10 - {"█ █"}, - {"█ ⊙log ██████████████████ █"}, // 13,12 - {"█ █"}, - {"█ ██████████████████ █"}, - {"█ █"}, - {"█ ██████████████████ █"}, - {"█ █"}, - {"█ ██████████████████ █"}, - {"█ █"}, - {"█ ██████████████████ █"}, - {"█ █"}, - {"███████████████████████████████"}, // 22 - {"▓ L O A D I N G:□□□□□□□□□□□ ▓"}, - {"▓ 加载文档 : ◇ 0000/1000 ◇ ▓"}, // 27 24 - {"▓ ▓"}, // 34 25 - {"▓ ▓"}, - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}}; + {"鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻"}, + {"鈻 鈻"}, + {"鈻 鈻犫枲 Getting Over It with Bennett Foddy 鈻犫枲 鈻"}, + {"鈻 鈻"}, + {"鈻 鈻犫枲 鈻解柦鈻解柦鈻解柦鈻解柦鈻解柦鈻解柦鈻解柦鈻解柦鈻解柦 鈻犫枲 鈻"}, + {"鈻 鈻犫枲 鈯欑▼搴忓悕瀛楋細 鎺樺湴姹傚崌 鈯 鈻犫枲 鈻"}, + {"鈻 鈻犫枲 鈯 鈯 鈻犫枲 鈻"}, + {"鈻 鈻犫枲 鈯欑増鏈俊鎭細 o.o.o 鈯 鈻犫枲 鈻"}, + {"鈻 鈻犫枲 鈯 鈯 鈻犫枲 鈻"}, + {"鈻 鈻犫枲 鈯欑▼搴忎綔鑰咃細 404name 鈯 鈻犫枲 鈻"}, + {"鈻 鈻犫枲 鈻斥柍鈻斥柍鈻斥柍鈻斥柍鈻斥柍鈻斥柍鈻斥柍鈻斥柍鈻斥柍 鈻犫枲 鈻"}, // 10 + {"鈻 鈻"}, + {"鈻 鈯檒og 鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅 鈻"}, // 13,12 + {"鈻 鈻"}, + {"鈻 鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅 鈻"}, + {"鈻 鈻"}, + {"鈻 鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅 鈻"}, + {"鈻 鈻"}, + {"鈻 鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅 鈻"}, + {"鈻 鈻"}, + {"鈻 鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅 鈻"}, + {"鈻 鈻"}, + {"鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻"}, // 22 + {"鈻 L O A D I N G锛氣枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴 鈻"}, + {"鈻 鍔犺浇鏂囨。 : 鈼 0000/1000 鈼 鈻"}, // 27 24 + {"鈻 鈻"}, // 34 25 + {"鈻 鈻"}, + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}}; /* - {"█ ■■ ⊙1.21 设置地图+整合游戏 ■■ █"}, + {"鈻 鈻犫枲 鈯1.21 璁剧疆鍦板浘+鏁村悎娓告垙 鈻犫枲 鈻"}, - {"█ █"},*/ + {"鈻 鈻"},*/ char end[200][800] = { - {"■■□□□■■□□□■■□□□□□□□□□□□□■■□■□□□"}, {"□■■□□□■□□□■■■■■□■■■■■■□□■■□■■□□"}, {"□□□■■■■■□■■■■■■□■■■■■■□□■■□□■□□"}, {"□□□■■■■■■■□□□□□□□□□□■■□□■■■■■■□"}, {"■■□□■■□□■□■■■■■□□□□□■■■■■■■■■■□"}, {"□■■□■■■■□□■■■■■□□■■□■■■■■■□□□□□"}, {"□□□□■■■■□□□□■■□□□■■□■■□□■■□□■□□"}, {"□□□□■■□■□■■■■■■□□□■■■□□□■■□■■□□"}, {"□□■□■■□■□■■■■■■□□□□■■□□□■■□■■□□"}, {"□□■□■■□■□□□■■□□□□□■■■■□□□■■■□□□"}, {"□■■□■■□■□□□■■□□□□■■□□■□□□■■□□□■"}, {"□■□□■■□■□□□■■□□□■■□□□□□□■■■■□■■"}, {"■■□■■■□■□□■■■□□□■□□□□□■■■□□■■■■"}, {"■■□■■□■■□□■■□□□□□□□□□□■■□□□□■■■"}, {"□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□"}, {"□□■■□□□□□■■□□□□□□□□□□□□■■□□□□□□"}, {"□□■■□□■■■■■■■■■□■■■■■■■■■■■■■■■"}, {"□■■□□□■■■■■■■■■□■■■■■■■■■■■■■■■"}, {"■■□□■■□□□■■□□□□□□□□□□□□■■□□□□□□"}, {"■■■■■■□■■■■■■■□□□□■■■■■■■■■■■■□"}, {"□□■■□□□■■■■■■■□□□□■■■■■■■■■■■■□"}, {"□■■□□□□□□□□□□□□□□□■■□□□■■□□□■■□"}, {"■■■■■■□■■■■■■■□□□□■■■■■■■■■■■■□"}, {"■■■■■■□■■■■■■■□□□□□□□■■■■■□□□□□"}, {"□□□□□□□■■□□□■■□□□□□□■■□■■■■□□□□"}, {"□□□■■■□■■□□□■■□□□□□■■□□■■□■■□□□"}, {"■■■■■■□■■■■■■■□□□■■■□□□■■□□■■■□"}, {"■■■□□□□■■■■■■■□□□■■□□□□■■□□□■■□"}, {"□□□□□□□■■□□□■■□□□□□□□□□■■□□□□□□"}}; + {"鈻犫枲鈻♀枴鈻♀枲鈻犫枴鈻♀枴鈻犫枲鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻犫枲鈻♀枲鈻♀枴鈻"}, {"鈻♀枲鈻犫枴鈻♀枴鈻犫枴鈻♀枴鈻犫枲鈻犫枲鈻犫枴鈻犫枲鈻犫枲鈻犫枲鈻♀枴鈻犫枲鈻♀枲鈻犫枴鈻"}, {"鈻♀枴鈻♀枲鈻犫枲鈻犫枲鈻♀枲鈻犫枲鈻犫枲鈻犫枴鈻犫枲鈻犫枲鈻犫枲鈻♀枴鈻犫枲鈻♀枴鈻犫枴鈻"}, {"鈻♀枴鈻♀枲鈻犫枲鈻犫枲鈻犫枲鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻犫枲鈻♀枴鈻犫枲鈻犫枲鈻犫枲鈻"}, {"鈻犫枲鈻♀枴鈻犫枲鈻♀枴鈻犫枴鈻犫枲鈻犫枲鈻犫枴鈻♀枴鈻♀枴鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻"}, {"鈻♀枲鈻犫枴鈻犫枲鈻犫枲鈻♀枴鈻犫枲鈻犫枲鈻犫枴鈻♀枲鈻犫枴鈻犫枲鈻犫枲鈻犫枲鈻♀枴鈻♀枴鈻"}, {"鈻♀枴鈻♀枴鈻犫枲鈻犫枲鈻♀枴鈻♀枴鈻犫枲鈻♀枴鈻♀枲鈻犫枴鈻犫枲鈻♀枴鈻犫枲鈻♀枴鈻犫枴鈻"}, {"鈻♀枴鈻♀枴鈻犫枲鈻♀枲鈻♀枲鈻犫枲鈻犫枲鈻犫枴鈻♀枴鈻犫枲鈻犫枴鈻♀枴鈻犫枲鈻♀枲鈻犫枴鈻"}, {"鈻♀枴鈻犫枴鈻犫枲鈻♀枲鈻♀枲鈻犫枲鈻犫枲鈻犫枴鈻♀枴鈻♀枲鈻犫枴鈻♀枴鈻犫枲鈻♀枲鈻犫枴鈻"}, {"鈻♀枴鈻犫枴鈻犫枲鈻♀枲鈻♀枴鈻♀枲鈻犫枴鈻♀枴鈻♀枴鈻犫枲鈻犫枲鈻♀枴鈻♀枲鈻犫枲鈻♀枴鈻"}, {"鈻♀枲鈻犫枴鈻犫枲鈻♀枲鈻♀枴鈻♀枲鈻犫枴鈻♀枴鈻♀枲鈻犫枴鈻♀枲鈻♀枴鈻♀枲鈻犫枴鈻♀枴鈻"}, {"鈻♀枲鈻♀枴鈻犫枲鈻♀枲鈻♀枴鈻♀枲鈻犫枴鈻♀枴鈻犫枲鈻♀枴鈻♀枴鈻♀枴鈻犫枲鈻犫枲鈻♀枲鈻"}, {"鈻犫枲鈻♀枲鈻犫枲鈻♀枲鈻♀枴鈻犫枲鈻犫枴鈻♀枴鈻犫枴鈻♀枴鈻♀枴鈻犫枲鈻犫枴鈻♀枲鈻犫枲鈻"}, {"鈻犫枲鈻♀枲鈻犫枴鈻犫枲鈻♀枴鈻犫枲鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻犫枲鈻♀枴鈻♀枴鈻犫枲鈻"}, {"鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻"}, {"鈻♀枴鈻犫枲鈻♀枴鈻♀枴鈻♀枲鈻犫枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枲鈻犫枴鈻♀枴鈻♀枴鈻"}, {"鈻♀枴鈻犫枲鈻♀枴鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枴鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻"}, {"鈻♀枲鈻犫枴鈻♀枴鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枴鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻"}, {"鈻犫枲鈻♀枴鈻犫枲鈻♀枴鈻♀枲鈻犫枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枲鈻犫枴鈻♀枴鈻♀枴鈻"}, {"鈻犫枲鈻犫枲鈻犫枲鈻♀枲鈻犫枲鈻犫枲鈻犫枲鈻♀枴鈻♀枴鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻"}, {"鈻♀枴鈻犫枲鈻♀枴鈻♀枲鈻犫枲鈻犫枲鈻犫枲鈻♀枴鈻♀枴鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻"}, {"鈻♀枲鈻犫枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻犫枲鈻♀枴鈻♀枲鈻犫枴鈻♀枴鈻犫枲鈻"}, {"鈻犫枲鈻犫枲鈻犫枲鈻♀枲鈻犫枲鈻犫枲鈻犫枲鈻♀枴鈻♀枴鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻"}, {"鈻犫枲鈻犫枲鈻犫枲鈻♀枲鈻犫枲鈻犫枲鈻犫枲鈻♀枴鈻♀枴鈻♀枴鈻♀枲鈻犫枲鈻犫枲鈻♀枴鈻♀枴鈻"}, {"鈻♀枴鈻♀枴鈻♀枴鈻♀枲鈻犫枴鈻♀枴鈻犫枲鈻♀枴鈻♀枴鈻♀枴鈻犫枲鈻♀枲鈻犫枲鈻犫枴鈻♀枴鈻"}, {"鈻♀枴鈻♀枲鈻犫枲鈻♀枲鈻犫枴鈻♀枴鈻犫枲鈻♀枴鈻♀枴鈻♀枲鈻犫枴鈻♀枲鈻犫枴鈻犫枲鈻♀枴鈻"}, {"鈻犫枲鈻犫枲鈻犫枲鈻♀枲鈻犫枲鈻犫枲鈻犫枲鈻♀枴鈻♀枲鈻犫枲鈻♀枴鈻♀枲鈻犫枴鈻♀枲鈻犫枲鈻"}, {"鈻犫枲鈻犫枴鈻♀枴鈻♀枲鈻犫枲鈻犫枲鈻犫枲鈻♀枴鈻♀枲鈻犫枴鈻♀枴鈻♀枲鈻犫枴鈻♀枴鈻犫枲鈻"}, {"鈻♀枴鈻♀枴鈻♀枴鈻♀枲鈻犫枴鈻♀枴鈻犫枲鈻♀枴鈻♀枴鈻♀枴鈻♀枴鈻♀枲鈻犫枴鈻♀枴鈻♀枴鈻"}}; char more_message[200][800] = { - {"懒得开发模块了"}, - {"按任意键继续"}, - {"游戏信息:掘地求升C语言版"}, - {"游戏作者:CTGU_LLZ "}, - {"游戏性质:寒假答辩作品"}, - {"开发日志:"}, - {"⊙1.15 实现跳跃与重力 "}, - {"⊙1.16-1.18 构建游戏框架 "}, - {"⊙1.19 实现关卡间跳跃 "}, - {"⊙1.20 写菜单+游戏整合 "}, - {"⊙1.21-later 丰富关卡+优化操作 "}, // 38 - {"更多相关内容:"}, - {"github:https://github.com/404name/C-game"}, - {"博客园:https://www.cnblogs.com/404name/"}, - {"启明星论坛:https://www.ctguqmx.com/article/category-14"}, - {"没了"}}; -char menu_message_1[10][20] = {{"取消"}, {"退出"}, {":开挂"}, {":返回"}, {":——"}, {":——"}}; + {"鎳掑緱寮鍙戞ā鍧椾簡"}, + {"鎸変换鎰忛敭缁х画"}, + {"娓告垙淇℃伅锛氭帢鍦版眰鍗嘋璇█鐗"}, + {"娓告垙浣滆咃細CTGU_LLZ "}, + {"娓告垙鎬ц川锛氬瘨鍋囩瓟杈╀綔鍝"}, + {"寮鍙戞棩蹇:"}, + {"鈯1.15 瀹炵幇璺宠穬涓庨噸鍔 "}, + {"鈯1.16-1.18 鏋勫缓娓告垙妗嗘灦 "}, + {"鈯1.19 瀹炵幇鍏冲崱闂磋烦璺 "}, + {"鈯1.20 鍐欒彍鍗+娓告垙鏁村悎 "}, + {"鈯1.21-later 涓板瘜鍏冲崱+浼樺寲鎿嶄綔 "}, // 38 + {"鏇村鐩稿叧鍐呭锛"}, + {"github锛歨ttps://github.com/404name/C-game"}, + {"鍗氬鍥細https://www.cnblogs.com/404name/"}, + {"鍚槑鏄熻鍧涳細https://www.ctguqmx.com/article/category-14"}, + {"娌′簡"}}; +char menu_message_1[10][20] = {{"鍙栨秷"}, {"閫鍑"}, {"锛氬紑鎸"}, {"锛氳繑鍥"}, {"锛氣斺"}, {"锛氣斺"}}; char loading_message[10][50] = { - {"⊙Bennett Foddy 通关游戏后飞向了太空 "}, - {"⊙他长时间暴露在宇宙射线下发生了变异 "}, - {"⊙变成了一只会玩锤子的可爱小白兔 M "}, - {"⊙并且只存活在C语言代码中 "}, - {"⊙你能帮他继续往上抡锤子吗 "}}; // 38 + {"鈯橞ennett Foddy 閫氬叧娓告垙鍚庨鍚戜簡澶┖ "}, + {"鈯欎粬闀挎椂闂存毚闇插湪瀹囧畽灏勭嚎涓嬪彂鐢熶簡鍙樺紓 "}, + {"鈯欏彉鎴愪簡涓鍙細鐜╅敜瀛愮殑鍙埍灏忕櫧鍏 M "}, + {"鈯欏苟涓斿彧瀛樻椿鍦–璇█浠g爜涓 "}, + {"鈯欎綘鑳藉府浠栫户缁線涓婃姟閿ゅ瓙鍚 "}}; // 38 char setting_message[8][100] = { - {"███████████████████████████████"}, - {"▓ ▓"}, - {"▓ 2 3 ▓"}, - {"▓ 4 5 ▓"}, - {"▓ ▓"}, // 27 42 + {"鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻"}, + {"鈻 鈻"}, + {"鈻 2 3 鈻"}, + {"鈻 4 5 鈻"}, + {"鈻 鈻"}, // 27 42 // 24-25 - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}}; + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}}; char exit_message[8][100] = { - {"███████████████████████████████"}, - {"▓ ▓"}, - {"▓ 是 否 确 认 退 出 游 戏 ▓"}, - {"▓ 0 1 ▓"}, - {"▓ ▓"}, // 27 42 + {"鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻"}, + {"鈻 鈻"}, + {"鈻 鏄 鍚 纭 璁 閫 鍑 娓 鎴 鈻"}, + {"鈻 0 1 鈻"}, + {"鈻 鈻"}, // 27 42 // 24-25 - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}}; + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}}; char menu[200][800] = { - {"███████████████████████████████"}, - {"█■■■■■■■■■■■ █"}, - {"█■■■■■■■■■■■■ _________ █"}, - {"█■■ 和Bennett Foddy一起■ /_______◎\\ █"}, - {"█■■■■■■■■攻克难关■|____ ____\\ █"}, - {"█■■■■■■■■■■■■■■ |*| █"}, - {"█■■■■■■■■■■■■■■ |*| 0 █"}, - {"█■■■■■■■■■■■■■■■ |*| 2 █"}, - {"█■■■■■■■■■■■■■■■ |*| 1 █"}, - {"█■■■■■■■■■■■■■■■ |*| 0 █"}, - {"█■■■■■■■■■■■■■■■ |*| 3 █"}, - {"█■■■■■■■■■■■■■■■ |*| 1 █"}, - {"█■■■■■■■■■■■■■■■ |*| 0 █"}, - {"█■■■■■■■■■■■■■■■ |*| 4 █"}, - {"█■■■■■■■■■■■■■■■ |*| 1 █"}, - {"█■■■■■■■■■■■■■■◤ |*| 0 █"}, - {"█■■■■■■■■■■■■■■ |*| 5 █"}, - {"█■■■■■■■■■■■■■■ |*| 1 █"}, - {"█■■■■■■■■■■■■■◤ |*| 0 █"}, - {"█■■■■■■■■■■■■■ |*| 6 █"}, - {"█■■■■■■■■■■■■■ |*| 1 █"}, - {"█version o.o.o■■■■■◤ |*| █"}, - {"███████████████████████████████"}, - {"▓ L O A D I N G:■■■■■■■■■■■■ ▓"}, - {"▓ 加载文档 : 成 功 加 载 ▓"}, - {"▓ Tip : 方向键可控制上下左右 ▓"}, - {"▓ ▓"}, - {"▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"}}; -char map[200][800]; //地图载体 -char message[10][3] = {{"⊙"}, {"●"}, {"□"}, {"■"}}; + {"鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻 _________ 鈻"}, + {"鈻堚枲鈻 鍜孊ennett Foddy涓璧封枲 /_______鈼嶾\ 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犳敾鍏嬮毦鍏斥枲|____ ____\\ 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻 |*| 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻 |*| 0 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲 |*| 2 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲 |*| 1 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲 |*| 0 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲 |*| 3 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲 |*| 1 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲 |*| 0 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲 |*| 4 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲 |*| 1 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫棨 |*| 0 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻 |*| 5 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻 |*| 1 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈼 |*| 0 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲 |*| 6 鈻"}, + {"鈻堚枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲 |*| 1 鈻"}, + {"鈻坴ersion o.o.o鈻犫枲鈻犫枲鈻犫棨 |*| 鈻"}, + {"鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻"}, + {"鈻 L O A D I N G锛氣枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻犫枲鈻 鈻"}, + {"鈻 鍔犺浇鏂囨。 : 鎴 鍔 鍔 杞 鈻"}, + {"鈻 Tip : 鏂瑰悜閿彲鎺у埗涓婁笅宸﹀彸 鈻"}, + {"鈻 鈻"}, + {"鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻"}}; +char map[200][800]; //鍦板浘杞戒綋 +char message[10][3] = {{"鈯"}, {"鈼"}, {"鈻"}, {"鈻"}}; char turn = '8', old_turn = turn; int now_pass = 0, old_pass = 0, back_to_last_pass_x = 0, if_back = 0; -int check[200] = {4, 5, 6, 7, 0, 1, 2, 3}; //让锤子位置和人位置相对相反 +int check[200] = {4, 5, 6, 7, 0, 1, 2, 3}; //璁╅敜瀛愪綅缃拰浜轰綅缃浉瀵圭浉鍙 int x = 7, y = 13, old_x = 7, old_y = 13, x_link = 7, y_link = 12, x_hammer = 7, y_hammer = 11, reset_x = x, reset_y = y; int direct_people = 6, old_direct_people = 6, direct_hammer = 2, @@ -475,23 +475,23 @@ int can_jump = 0, jumpturn = 8, jump_time = 0; int gravity_on = 1, jump_up_flag = 0, paste = 0, old_paste, G_flag = 0, game_end = 0; int next[8][2] = {{-1, 0}, {-1, -1}, {0, -1}, {1, -1}, {1, 0}, {1, 1}, {0, 1}, {-1, 1}}; -// 0左 1左上 2上 3右上 4右 5右下 6下 -// 7左下 +// 0宸 1宸︿笂 2涓 3鍙充笂 4鍙 5鍙充笅 6涓 +// 7宸︿笅 int jumpform[8][11] = { - //对应next - //两倍 - {1, 2}, // 0直接跳 (0下标为执行次数,后面记录状态) - {3, 4, 4, 6}, // 1右小跳 - {3, 0, 0, 6}, // 2左小跳 - {4, 2, 4, 4, 6}, // 3右翻越 - {4, 2, 0, 0, 6}, // 4左翻越 - {4, 0, 2, 2, 4}, // 5下 - {4, 2, 2, 0, 0}, // 6左上 - {4, 2, 2, 4, 4}, // 7右上 + //瀵瑰簲next + //涓ゅ + {1, 2}, // 0鐩存帴璺 (0涓嬫爣涓烘墽琛屾鏁,鍚庨潰璁板綍鐘舵) + {3, 4, 4, 6}, // 1鍙冲皬璺 + {3, 0, 0, 6}, // 2宸﹀皬璺 + {4, 2, 4, 4, 6}, // 3鍙崇炕瓒 + {4, 2, 0, 0, 6}, // 4宸︾炕瓒 + {4, 0, 2, 2, 4}, // 5涓 + {4, 2, 2, 0, 0}, // 6宸︿笂 + {4, 2, 2, 4, 4}, // 7鍙充笂 }; -int message_place[10][2] = {{0, 0}, {2, 26}, {4, 26}, {6, 26}, {2, 25}, {4, 25}, {6, 25}, {2, 24}, {4, 24}, {6, 24}}; // x 水平 +int message_place[10][2] = {{0, 0}, {2, 26}, {4, 26}, {6, 26}, {2, 25}, {4, 25}, {6, 25}, {2, 24}, {4, 24}, {6, 24}}; // x 姘村钩 int direct_hammer_to_message_place[8] = {4, 7, 8, 9, 6, 3, 2, 1}; -int jumpform_to_direct_hammer[8][11] = { // jump时保持锤子不动 两倍 +int jumpform_to_direct_hammer[8][11] = { // jump鏃朵繚鎸侀敜瀛愪笉鍔 涓ゅ {8, 8}, {8, 6, 7, 0}, {8, 6, 5, 4}, @@ -502,18 +502,18 @@ int jumpform_to_direct_hammer[8][11] = { // jump时 {8, 4, 5, 6, 7}}; int direct_people_to_jump[8] = {3, 1, 0, 2, 4, 6, 5, 7}; -int back_pass_trigger[80][80] = {0}; // 0没事 1返回上一关 -int next_pass_trigger[80][80] = {0}; // 0没事 1下一关 +int back_pass_trigger[80][80] = {0}; // 0娌′簨 1杩斿洖涓婁竴鍏 +int next_pass_trigger[80][80] = {0}; // 0娌′簨 1涓嬩竴鍏 int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, int xx, int yy) { - //主要函数 :灵活的实现选择指针; - //参数:开始坐标x y 限制活动空间 x左右 y 上下 移动距离 x y + //涓昏鍑芥暟 锛氱伒娲荤殑瀹炵幇閫夋嫨鎸囬拡锛 + //鍙傛暟锛氬紑濮嬪潗鏍噚 y 闄愬埗娲诲姩绌洪棿 x宸﹀彸 y 涓婁笅 绉诲姩璺濈 x y int tx = x, ty = y, i; gotoxy(x - 14, y); - printf("▉"); + printf("鈻"); gotoxy(x, y); - printf("▉"); //可自定义2个字节的指针图标 + printf("鈻"); //鍙嚜瀹氫箟2涓瓧鑺傜殑鎸囬拡鍥炬爣 char ch = '\0', ch1 = '\0'; char res[20]; while (ch != ' ') @@ -523,7 +523,7 @@ int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, ch != -32) continue; if (ch == -32) - { //同时启用wasd 和上下左右键 + { //鍚屾椂鍚敤wasd 鍜屼笂涓嬪乏鍙抽敭 ch1 = getch(); switch (ch1) { @@ -569,9 +569,9 @@ int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, } ty = y, tx = x; gotoxy(x - 14, y); - printf("▉"); + printf("鈻"); gotoxy(x, y); - printf("▉"); + printf("鈻"); } return map[y][x] - '0'; } @@ -586,10 +586,10 @@ int init() check['6'] = 4; check['3'] = 5; check['2'] = 6; - check['1'] = 7; //直接让锤子移动对应next; + check['1'] = 7; //鐩存帴璁╅敜瀛愮Щ鍔ㄥ搴攏ext锛 check['a'] = 0; check['d'] = 4; - for (int i = 2; i < 60; i++) //触发坠落 + for (int i = 2; i < 60; i++) //瑙﹀彂鍧犺惤 { back_pass_trigger[22][i] = 1; } @@ -599,7 +599,7 @@ int init() } Sleep(200); gotoxy(13, 12); - printf("按任意键开始加载◇◇◇(按p直接跳过)"); + printf("鎸変换鎰忛敭寮濮嬪姞杞解棁鈼団棁(鎸塸鐩存帴璺宠繃)"); char temp = getch(); if (temp == 'p') return 1; @@ -615,7 +615,7 @@ int init() if (i % 91 == 0) { gotoxy(27 + (2 * flag_2), 23); - printf("■"); + printf("鈻"); flag_2++; } gotoxy(33, 24); @@ -623,10 +623,10 @@ int init() Sleep(load_speed); } gotoxy(12, 25); - printf("⊙帮助它(按任意键进入游戏)"); + printf("鈯欏府鍔╁畠(鎸変换鎰忛敭杩涘叆娓告垙)"); Sleep(200); gotoxy(12, 26); - printf("⊙玩个锤子的兔子啊(按P拒绝)"); + printf("鈯欑帺涓敜瀛愮殑鍏斿瓙鍟(鎸塒鎷掔粷)"); char ch = getch(); if (ch == 'p' || ch == 'P') return 0; @@ -634,7 +634,7 @@ int init() return 1; } -void load_game() //读取关卡信息 +void load_game() //璇诲彇鍏冲崱淇℃伅 { gotoxy(0, 0); int i, j; @@ -643,7 +643,7 @@ void load_game() // for (i = 0; i <= 27; i++) strcpy(map[i], s[now_pass].map[i]); if (back_to_last_pass_x == 0) - { //正常通关 + { //姝e父閫氬叧 x = s[now_pass].start_x; y = s[now_pass].start_y; } @@ -656,23 +656,23 @@ void load_game() // old_x = x, old_y = y; x_link = x, y_link = y - 1; x_hammer = x, y_hammer = x - 2; - for (i = 0; i < 8; i++) //新的下一关触发器设置 + for (i = 0; i < 8; i++) //鏂扮殑涓嬩竴鍏宠Е鍙戝櫒璁剧疆 next_pass_trigger[s[old_pass].next_y + next[i][1]] [s[old_pass].next_x + next[i][0]] = 0; - for (i = 0; i < 8; i++) //新的下一关触发器设置 + for (i = 0; i < 8; i++) //鏂扮殑涓嬩竴鍏宠Е鍙戝櫒璁剧疆 next_pass_trigger[s[now_pass].next_y + next[i][1]] [s[now_pass].next_x + next[i][0]] = 1; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7); for (i = 0; i <= 22; i++) printf("%s\n", map[i]); - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 8); //附加信息框 + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 8); //闄勫姞淇℃伅妗 for (i = 23; i <= 27; i++) printf("%s\n", map[i]); gotoxy(x, y); printf("%c", people); } -void show_move() //移动显示 +void show_move() //绉诲姩鏄剧ず { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 00); if (old_x != x || old_y != y) @@ -693,11 +693,11 @@ void show_move() // gotoxy(x_hammer, y_hammer); printf(" "); } - //消除上次 + //娑堥櫎涓婃 if (jump_time && jumpform_to_direct_hammer[jumpturn][jumpform[jumpturn][0] + 1 - jump_time] != 8) - { //锤子不动 + { //閿ゅ瓙涓嶅姩 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); gotoxy(message_place[direct_hammer_to_message_place[direct_hammer]][0], message_place[direct_hammer_to_message_place[direct_hammer]][1]); @@ -721,7 +721,7 @@ void show_move() // printf("%2s", message[1]); } else - { //锤子伴随人动 + { //閿ゅ瓙浼撮殢浜哄姩 x_link = x + next[direct_hammer][0]; y_link = y + next[direct_hammer][1]; x_hammer = x + 2 * next[direct_hammer][0]; @@ -739,16 +739,16 @@ void show_move() // map[y_hammer][x_hammer] = hammer; gotoxy(x_hammer, y_hammer); printf("%c", hammer); - } //更新下一次 + } //鏇存柊涓嬩竴娆 gotoxy(x, y); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 8); printf("%c", people); gotoxy(x, y); - /*gotoxy(0,30); //打印坐标信息 + /*gotoxy(0,30); //鎵撳嵃鍧愭爣淇℃伅 printf("x is %d\ny is %d",x,y); */ } -void autochange() //系统自动更新 +void autochange() //绯荤粺鑷姩鏇存柊 { old_paste = paste; old_x = x; @@ -824,7 +824,7 @@ void autochange() //系统 else if (gravity_on == 1 && (map[y + 1][x] == ' ' || map[y + 1][x] == link || map[y + 1][x] == hammer)) - { //重力下坠 + { //閲嶅姏涓嬪潬 y++; show_move(); Sleep(100); @@ -835,12 +835,12 @@ void autochange() //系统 jumpturn = 8; } gravity_on = 1; - paste = 0; //是否黏住 + paste = 0; //鏄惁榛忎綇 if (map[y_hammer][x_hammer] == - hammer) //若锤子固定 则取消重力 取消跳跃状态。 + hammer) //鑻ラ敜瀛愬浐瀹 鍒欏彇娑堥噸鍔 鍙栨秷璺宠穬鐘舵併 for (int i = 0; i < 8; i += 2) { - /*if (i == 2) //取消上方粘 + /*if (i == 2) //鍙栨秷涓婃柟绮 continue;*/ if (map[y_hammer + next[i][1]][x_hammer + next[i][0]] != link && map[y_hammer + next[i][1]][x_hammer + next[i][0]] != ' ') @@ -852,7 +852,7 @@ void autochange() //系统 } } if (old_paste != paste) - { //显示粘贴信息 + { //鏄剧ず绮樿创淇℃伅 gotoxy(message_place[5][0], message_place[5][1]); printf("%2s", message[paste + 2]); gotoxy(x, y); @@ -867,7 +867,7 @@ void autochange() //系统 else printf("no drop");*/ } -void manchange() //人为输入更新 +void manchange() //浜轰负杈撳叆鏇存柊 { if (kbhit()) { @@ -886,7 +886,7 @@ void manchange() // can_jump = 1; } /*else if (turn == 'a' || turn == 'd' || turn == 'w' || turn == 's') - //为了优化操作取消wasd控制人物 + //涓轰簡浼樺寲鎿嶄綔鍙栨秷wasd鎺у埗浜虹墿 { if (paste == 0 && (map[y + next[check[turn]][1]][x + next[check[turn]][0]] == ' ' || map[y + next[check[turn]][1]][x + @@ -967,7 +967,7 @@ void manchange() // { if_back = 1; } - /*else if (turn == 'q' || turn == 'e') //遇到障碍物会卡住 + /*else if (turn == 'q' || turn == 'e') //閬囧埌闅滅鐗╀細鍗′綇 { if (turn == 'q') direct_hammer--; @@ -980,8 +980,8 @@ void manchange() // direct_people = check[direct_hammer]; show_move(); }*/ - //困难模式开启0.0 - else if (turn >= '1' && turn <= '9' && turn != '5') //不卡住 + //鍥伴毦妯″紡寮鍚0.0 + else if (turn >= '1' && turn <= '9' && turn != '5') //涓嶅崱浣 { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); gotoxy( @@ -989,7 +989,7 @@ void manchange() // message_place[direct_hammer_to_message_place[direct_hammer]] [1]); printf("%2s", message[0]); - direct_hammer = check[turn]; //数字键盘快捷改变方向 + direct_hammer = check[turn]; //鏁板瓧閿洏蹇嵎鏀瑰彉鏂瑰悜 direct_people = check[direct_hammer]; gotoxy( message_place[direct_hammer_to_message_place[direct_hammer]][0], @@ -1017,7 +1017,7 @@ void manchange() // } } } -//后面是相应的首页菜单功能 +//鍚庨潰鏄浉搴旂殑棣栭〉鑿滃崟鍔熻兘 void more() { char ch; @@ -1044,7 +1044,7 @@ void exit() if (map[i][j] >= '0' && map[i][j] <= '9') { gotoxy(j - 11, i); - printf("◆ %s ◆", menu_message_1[map[i][j] - '0']); + printf("鈼 %s 鈼", menu_message_1[map[i][j] - '0']); gotoxy(j + 1, i); } else if (i == 0 || i == 22 || i == 23 || i == 27 || j == 1 || @@ -1062,7 +1062,7 @@ void exit() printf("\n"); } int flag = - move(27, 25, 27, 42, 25, 25, 15, 0); // 2新游戏 3选关卡 4更多 5退出 + move(27, 25, 27, 42, 25, 25, 15, 0); // 2鏂版父鎴 3閫夊叧鍗 4鏇村 5閫鍑 switch (flag) { case 0: @@ -1086,13 +1086,13 @@ void setting() if (map[i][j] == '2' && G_flag == 0) { gotoxy(j - 10, i); - printf("◇%s", menu_message_1[map[i][j] - '0']); + printf("鈼%s", menu_message_1[map[i][j] - '0']); gotoxy(j + 1, i); } else if (map[i][j] >= '0' && map[i][j] <= '9') { gotoxy(j - 10, i); - printf("◆%s", menu_message_1[map[i][j] - '0']); + printf("鈼%s", menu_message_1[map[i][j] - '0']); gotoxy(j + 1, i); } else if (i == 0 || i == 22 || i == 23 || i == 27 || j == 1 || @@ -1110,7 +1110,7 @@ void setting() printf("\n"); } int flag = move(27, 24, 27, 50, 24, 25, 15, - 1); // 2新游戏 3选关卡 4更多 5退出//28 43 24-25 + 1); // 2鏂版父鎴 3閫夊叧鍗 4鏇村 5閫鍑//28 43 24-25 switch (flag) { case 2: @@ -1184,7 +1184,7 @@ void game_system() void select() { - int flag = move(52, 7, 52, 52, 7, 19, 0, 3); // 2新游戏 3选关卡 4更多 5退出 + int flag = move(52, 7, 52, 52, 7, 19, 0, 3); // 2鏂版父鎴 3閫夊叧鍗 4鏇村 5閫鍑 switch (flag) { case 2: @@ -1215,7 +1215,7 @@ int main() { show_menu(); int flag = move(52, 7, 52, 52, 7, 19, 0, - 3); // 2新游戏 3选关卡 4更多 5退出 + 3); // 2鏂版父鎴 3閫夊叧鍗 4鏇村 5閫鍑 switch (flag) { case 2: @@ -1248,17 +1248,17 @@ int main() } Sleep(10000); system("cls"); - printf("游戏结束"); + printf("娓告垙缁撴潫"); return 0; } -// bug区 +// bug鍖 -//设置如何储存继续(p退出后直接进去就是继续,新游戏就会初始化) ok -//需要解决wasd移动左下角不变化 ok删除wasd -//解决进入下一关随机的bug ok -//解决hammer在触发器上没反应的情况 autochange里面 ok +//璁剧疆濡備綍鍌ㄥ瓨缁х画锛坧閫鍑哄悗鐩存帴杩涘幓灏辨槸缁х画锛屾柊娓告垙灏变細鍒濆鍖栵級 ok +//闇瑕佽В鍐硍asd绉诲姩宸︿笅瑙掍笉鍙樺寲 ok鍒犻櫎wasd +//瑙e喅杩涘叆涓嬩竴鍏抽殢鏈虹殑bug ok +//瑙e喅hammer鍦ㄨЕ鍙戝櫒涓婃病鍙嶅簲鐨勬儏鍐 autochange閲岄潰 ok -//优化区 -//设置颜色 ok淡色 -//设置更丰富的关卡 ok -//设置初始教程 ok +//浼樺寲鍖 +//璁剧疆棰滆壊 ok娣¤壊 +//璁剧疆鏇翠赴瀵岀殑鍏冲崱 ok +//璁剧疆鍒濆鏁欑▼ ok diff --git "a/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254\357\274\210\346\213\223\345\261\225\345\256\214\345\226\204\347\211\210\357\274\211/win10_ver_3.0/\350\207\252\350\241\214\345\244\215\345\210\266\347\274\226\350\257\221\345\215\263\345\217\257.txt" "b/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254\357\274\210\346\213\223\345\261\225\345\256\214\345\226\204\347\211\210\357\274\211/win10_ver_3.0/\350\207\252\350\241\214\345\244\215\345\210\266\347\274\226\350\257\221\345\215\263\345\217\257.txt" index fbab870..67698a7 100644 --- "a/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254\357\274\210\346\213\223\345\261\225\345\256\214\345\226\204\347\211\210\357\274\211/win10_ver_3.0/\350\207\252\350\241\214\345\244\215\345\210\266\347\274\226\350\257\221\345\215\263\345\217\257.txt" +++ "b/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254\357\274\210\346\213\223\345\261\225\345\256\214\345\226\204\347\211\210\357\274\211/win10_ver_3.0/\350\207\252\350\241\214\345\244\215\345\210\266\347\274\226\350\257\221\345\215\263\345\217\257.txt" @@ -1,58 +1,58 @@ /*--------------------------------------------------------- -程序: 模拟笔记本电脑 (纯C语言,可直接编译器运行) -作者: 404name -说明: 1.这个程序本意在模拟电脑的基本功能,重在实现键盘的输入与键盘的控制,模拟开机,输密,打开软件,关闭电脑,所以其他功能暂没开发,不用太失望。 - 2.不同的编码会有不同的长度显示,但运行出来的效果都是一样的 - 3.代码规范不到位,见谅。 - 4.大一上写的,一般写小游戏练手,也琢磨到一些特殊的处理方法,所以对一些功能处理上有一些难理解的地方。 - 5.emmm,没啥了 - 6.感觉大一下太难了。qwq,在家学习效率太低。尽力学点新东西把。 -程序进度: 于2.10号停止更新(目前不再会加入新功能了,模板搭建完了,功能已经全部写完,再加入一些东西也没太大意义,还是去学学java去了) -程序结构: 程序因为加入了打砖块,部分函数顺序需要调换,影响体验。此处给出按顺序的走法。 - 这里其实总体上是有顺序的,但代码太多看起来就很乱。 - 解决方案:先定义函数再在主函数后面分类写。并没有采用,因为习惯性写前面,嘿嘿。。 +绋嬪簭锛 妯℃嫙绗旇鏈數鑴 锛堢函C璇█锛屽彲鐩存帴缂栬瘧鍣ㄨ繍琛岋級 +浣滆咃細 404name +璇存槑锛 1.杩欎釜绋嬪簭鏈剰鍦ㄦā鎷熺數鑴戠殑鍩烘湰鍔熻兘锛岄噸鍦ㄥ疄鐜伴敭鐩樼殑杈撳叆涓庨敭鐩樼殑鎺у埗锛屾ā鎷熷紑鏈猴紝杈撳瘑锛屾墦寮杞欢锛屽叧闂數鑴戯紝鎵浠ュ叾浠栧姛鑳芥殏娌″紑鍙戯紝涓嶇敤澶け鏈涖 + 2.涓嶅悓鐨勭紪鐮佷細鏈変笉鍚岀殑闀垮害鏄剧ず锛屼絾杩愯鍑烘潵鐨勬晥鏋滈兘鏄竴鏍风殑 + 3.浠g爜瑙勮寖涓嶅埌浣嶏紝瑙佽皡銆 + 4.澶т竴涓婂啓鐨勶紝涓鑸啓灏忔父鎴忕粌鎵嬶紝涔熺悽纾ㄥ埌涓浜涚壒娈婄殑澶勭悊鏂规硶锛屾墍浠ュ涓浜涘姛鑳藉鐞嗕笂鏈変竴浜涢毦鐞嗚В鐨勫湴鏂广 + 5.emmm锛屾病鍟ヤ簡 + 6.鎰熻澶т竴涓嬪お闅句簡銆俼wq锛屽湪瀹跺涔犳晥鐜囧お浣庛傚敖鍔涘鐐规柊涓滆タ鎶娿 +绋嬪簭杩涘害锛 浜2.10鍙峰仠姝㈡洿鏂帮紙鐩墠涓嶅啀浼氬姞鍏ユ柊鍔熻兘浜嗭紝妯℃澘鎼缓瀹屼簡锛屽姛鑳藉凡缁忓叏閮ㄥ啓瀹岋紝鍐嶅姞鍏ヤ竴浜涗笢瑗夸篃娌″お澶ф剰涔夛紝杩樻槸鍘诲瀛ava鍘讳簡锛 +绋嬪簭缁撴瀯锛 绋嬪簭鍥犱负鍔犲叆浜嗘墦鐮栧潡锛岄儴鍒嗗嚱鏁伴『搴忛渶瑕佽皟鎹紝褰卞搷浣撻獙銆傛澶勭粰鍑烘寜椤哄簭鐨勮蛋娉曘 + 杩欓噷鍏跺疄鎬讳綋涓婃槸鏈夐『搴忕殑锛屼絾浠g爜澶鐪嬭捣鏉ュ氨寰堜贡銆 + 瑙e喅鏂规锛氬厛瀹氫箟鍑芥暟鍐嶅湪涓诲嚱鏁板悗闈㈠垎绫诲啓銆傚苟娌℃湁閲囩敤锛屽洜涓轰範鎯у啓鍓嶉潰锛屽樋鍢裤傘 - |变量区:(数组+变量) - |子函数区: - ·系统自带函数:光标隐藏+gotoxy - ·汉诺塔执行相关函数 - ·主程序init函数 - ·主程序界面加载函数: - ·开机画面 - ·关机画面 - ·蓝屏画面 - ·更多信息画面 - ·电脑系统配置画面 - ·打砖块执行相关函数 - ·主程序功能函数: - ·处理返回的字符型按键函数 - ·处理返回的功能型按键函数 - |主函数: - ·主循环 -修复历史: - (2020) - 3.10修复字符显示乱码 - 3.15修复关机仍能输入密码 - 3.15加入光标隐藏(关闭前往init函数第一行) - 3.19加入可移动游戏简洁版,可前往main函数自己开关 - 4.07丰富细节,更加贴近xp系统。 - ·密码输入优化,输入的密码会在下一次输入变成不可视。 - ·优化打砖块对角碰撞算法,更加真实。 - ·新增“此电脑”可查看电脑配置. - ·新增关机画面。 - ·优化细节. -指路区: 1.自制地图插入 前往my_map[][]数组 大概300多行处修改; - 2.打砖块抛物线算法解析 前往autochange()函数 1000多行处 + |鍙橀噺鍖猴細锛堟暟缁+鍙橀噺锛 + |瀛愬嚱鏁板尯锛 + 路绯荤粺鑷甫鍑芥暟锛氬厜鏍囬殣钘+gotoxy + 路姹夎濉旀墽琛岀浉鍏冲嚱鏁 + 路涓荤▼搴廼nit鍑芥暟 + 路涓荤▼搴忕晫闈㈠姞杞藉嚱鏁帮細 + 路寮鏈虹敾闈 + 路鍏虫満鐢婚潰 + 路钃濆睆鐢婚潰 + 路鏇村淇℃伅鐢婚潰 + 路鐢佃剳绯荤粺閰嶇疆鐢婚潰 + 路鎵撶爾鍧楁墽琛岀浉鍏冲嚱鏁 + 路涓荤▼搴忓姛鑳藉嚱鏁帮細 + 路澶勭悊杩斿洖鐨勫瓧绗﹀瀷鎸夐敭鍑芥暟 + 路澶勭悊杩斿洖鐨勫姛鑳藉瀷鎸夐敭鍑芥暟 + |涓诲嚱鏁帮細 + 路涓诲惊鐜 +淇鍘嗗彶锛 + 锛2020锛 + 3.10淇瀛楃鏄剧ず涔辩爜 + 3.15淇鍏虫満浠嶈兘杈撳叆瀵嗙爜 + 3.15鍔犲叆鍏夋爣闅愯棌锛堝叧闂墠寰init鍑芥暟绗竴琛岋級 + 3.19鍔犲叆鍙Щ鍔ㄦ父鎴忕畝娲佺増锛屽彲鍓嶅線main鍑芥暟鑷繁寮鍏 + 4.07涓板瘜缁嗚妭锛屾洿鍔犺创杩憍p绯荤粺銆 + 路瀵嗙爜杈撳叆浼樺寲锛岃緭鍏ョ殑瀵嗙爜浼氬湪涓嬩竴娆¤緭鍏ュ彉鎴愪笉鍙銆 + 路浼樺寲鎵撶爾鍧楀瑙掔鎾炵畻娉曪紝鏇村姞鐪熷疄銆 + 路鏂板鈥滄鐢佃剳鈥濆彲鏌ョ湅鐢佃剳閰嶇疆. + 路鏂板鍏虫満鐢婚潰銆 + 路浼樺寲缁嗚妭. +鎸囪矾鍖猴細 1.鑷埗鍦板浘鎻掑叆 鍓嶅線my_map[][]鏁扮粍 澶ф300澶氳澶勪慨鏀癸紱 + 2.鎵撶爾鍧楁姏鐗╃嚎绠楁硶瑙f瀽 鍓嶅線autochange()鍑芥暟 1000澶氳澶 ---------------------------------------------------------*/ -#include //用于getch() +#include //鐢ㄤ簬getch锛堬級 #include #include #include #include #define pi 3.14 -const double g = 10; //标准数越模糊,轨迹越连贯。 -char start[20][500] = { //图形界面 - {"┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"}, +const double g = 10; //鏍囧噯鏁拌秺妯$硦锛岃建杩硅秺杩炶疮銆 +char start[20][500] = { //鍥惧舰鐣岄潰 + {"鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, {" \\ /"}, {" \\ /"}, {" \\ /"}, @@ -64,50 +64,50 @@ char start[20][500] = { //图 {" \\ \\/ \\/ | | | |_| |_| \\/\\/ __/ /"}, {" \\ /"}, {" \\ _____________________ /"}, - {" \\ │ │ /"}, - {" \\ └────────────────────┘ /"}, + {" \\ 鈹 鈹 /"}, + {" \\ 鈹斺攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 /"}, {" \\ /"}, - {" \\ Copyright Θ Microsoft Corporation Microsoft /"}, + {" \\ Copyright 螛 Microsoft Corporation Microsoft /"}, {" \\ __________________________________________________________________________________________/"}}; char password[20][500] = { - {"┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"}, + {"鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, {" \\ /"}, {" \\ ------------------------------------------------------------------------------------------------------------------ /"}, {" \\ /"}, {" \\ | /"}, {" \\ | /"}, - {" \\ | ┌───────────────────────────────────────────── /"}, - {" \\ /~/~/ | │┌─────┐ Administrator /"}, - {" \\ /~/~/ __XP | ││ [] │ 输入密码 /"}, - {" \\ \\ /\\ / - _ _| _ ~ ~ /_ | │└─────┘ 【| 】ck[→] /"}, - {" \\ \\/ \\/ | | | |_| |_| \\/\\/ __/ | └─────────────────────────────────────── /"}, + {" \\ | 鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 /"}, + {" \\ /~/~/ | 鈹傗攲鈹鈹鈹鈹鈹鈹 Administrator /"}, + {" \\ /~/~/ __XP | 鈹傗攤 [] 鈹 杈撳叆瀵嗙爜 /"}, + {" \\ \\ /\\ / - _ _| _ ~ ~ /_ | 鈹傗敂鈹鈹鈹鈹鈹鈹 銆恷 銆慶k[鈫抅 /"}, + {" \\ \\/ \\/ | | | |_| |_| \\/\\/ __/ | 鈹斺攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 /"}, {" \\ | /"}, - {" \\ 要开始,请单击您的用户名 | /"}, + {" \\ 瑕佸紑濮嬶紝璇峰崟鍑绘偍鐨勭敤鎴峰悕 | /"}, {" \\ | /"}, {" \\ /"}, {" \\ ---------------------------------------------------------------------------------------- /"}, {" \\ __________________________________________________________________________________________/"}}; char desktop[20][500] = { - {"┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"}, - {" \\ ───── ───── ───── ┌────┐ ┌────┐ /"}, - {" \\ \\ \\ \\ \\ \\ \\ │ │ │ing │ /"}, - {" \\ ───── ───── ───── └────┘ └────┘ /"}, - {" \\ 汉诺塔 打砖块 我的电脑 相关 待开发 /"}, - {" \\ ───── /"}, + {"鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, + {" \\ 鈹鈹鈹鈹鈹 鈹鈹鈹鈹鈹 鈹鈹鈹鈹鈹 鈹屸攢鈹鈹鈹鈹 鈹屸攢鈹鈹鈹鈹 /"}, + {" \\ \\ \\ \\ \\ \\ \\ 鈹 鈹 鈹俰ng 鈹 /"}, + {" \\ 鈹鈹鈹鈹鈹 鈹鈹鈹鈹鈹 鈹鈹鈹鈹鈹 鈹斺攢鈹鈹鈹鈹 鈹斺攢鈹鈹鈹鈹 /"}, + {" \\ 姹夎濉 鎵撶爾鍧 鎴戠殑鐢佃剳 鐩稿叧 寰呭紑鍙 /"}, + {" \\ 鈹鈹鈹鈹鈹 /"}, {" \\ \\ \\ /"}, - {" \\ ───── __ --------------- __ __ /"}, - {" \\ IE浏览器__-- --- __ -------_ -------_------____ /"}, + {" \\ 鈹鈹鈹鈹鈹 __ --------------- __ __ /"}, + {" \\ IE娴忚鍣╛_-- --- __ -------_ -------_------____ /"}, {" \\ ____ __--__ -- __ -------_ --- - __ --- __ --------------______ /"}, {" \\__ -------_--__ ------- __ ---------- __ ------ __ ------ __ --- __ ---------____ /"}, {" \\ -------_---__ ------- _---- __ -------_ ---_ -------_ -_ ----------_ -_---_ -_ ------_ -_ /"}, {" \\--__ -- __ ----- __ ------ __ -------_ --- ---- __ -------_ -_ ---------_ -_ ------_ -_ ------ /"}, {" \\ -_--__ ------- _---- __ -------_ ------- __ -------_ -- __ -------_ -_ --------__---_ -_ ------/"}, {" \\ _____________________________________________________________________________________________ /"}, - {" \\ 开始 \\ qq2010 | | 12:00 /"}, + {" \\ 寮濮 \\ qq2010 | | 12:00 /"}, {" \\ __________________________________________________________________________________________/"}}; char game_hnt[20][500] = { - {"┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"}, - {" \\ ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ /"}, + {"鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, + {" \\ 鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 /"}, {" \\ /"}, {" \\ /"}, {" \\ /"}, @@ -119,48 +119,48 @@ char game_hnt[20][500] = { {" \\ /"}, {" \\ /"}, {" \\ /"}, - {" \\ └───────────────────────────────────────────────────────────────────────────────────────────┘ /"}, + {" \\ 鈹斺攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 /"}, {" \\ _____________________________________________________________________________________________ /"}, - {" \\ 开始 \\ qq2010 | 汉诺塔自动演示小游戏 | | 12:08 /"}, + {" \\ 寮濮 \\ qq2010 | 姹夎濉旇嚜鍔ㄦ紨绀哄皬娓告垙 | | 12:08 /"}, {" \\ __________________________________________________________________________________________/"}}; char MyComputer[20][500] = { - {"┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"}, - {" \\ ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ /"}, - {" \\ \\系统属性| |?| X / /"}, - {" \\ \\= 常规 =|计算机名|硬件|高级|自动更新|远程| / /"}, - {" \\ \\ 系统: / /"}, + {"鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, + {" \\ 鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 /"}, + {" \\ \\绯荤粺灞炴 |锛焲 X / /"}, + {" \\ \\= 甯歌 =|璁$畻鏈哄悕|纭欢|楂樼骇|鑷姩鏇存柊|杩滅▼| / /"}, + {" \\ \\ 绯荤粺锛 / /"}, {" \\ \\ +------------+ Microsoft Windows XP/ /"}, {" \\ \\ | /~/~/ | Professional / /"}, - {" \\ \\ | /~/~/ | 版本 2.3.3.3 / /"}, + {" \\ \\ | /~/~/ | 鐗堟湰 2.3.3.3 / /"}, {" \\ \\ +------------+ / /"}, - {" \\ \\ ---- 绝伦 && 404name / /"}, - {" \\ \\ 制造商和技术支持商 : Pentium(R) Core CPU / /"}, - {" \\ \\ M i c r o s o f t 2.52GHz, 1.99GB内存 / /"}, - {" \\ \\ 技术支持信息(S) / /"}, - {" \\ └───────────────────────────────────────────────────────────────────────────────────────────┘ /"}, + {" \\ \\ ---- 缁濅鸡 && 404name / /"}, + {" \\ \\ 鍒堕犲晢鍜屾妧鏈敮鎸佸晢 : Pentium(R) Core CPU / /"}, + {" \\ \\ M i c r o s o f t 2.52GHz, 1.99GB鍐呭瓨 / /"}, + {" \\ \\ 鎶鏈敮鎸佷俊鎭(S) / /"}, + {" \\ 鈹斺攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 /"}, {" \\ _____________________________________________________________________________________________ /"}, - {" \\ 开始 \\ qq2010 | 系统属性 | | 12:08 /"}, + {" \\ 寮濮 \\ qq2010 | 绯荤粺灞炴 | | 12:08 /"}, {" \\ __________________________________________________________________________________________/"}}; char thinking[30][500] = { - {"┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"}, - {" \\ ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ /"}, - {" \\ 这里是相关:(最后更新2020.2.11) /"}, + {"鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, + {" \\ 鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 /"}, + {" \\ 杩欓噷鏄浉鍏筹細锛堟渶鍚庢洿鏂2020.2.11锛 /"}, {" \\ /"}, - {" \\ 寒假太颓废了,没劲学习,游戏玩腻,然后开始发呆。安静下来时才有灵感 ,看着笔记本,就想着我也编一个电脑系统吧 /"}, + {" \\ 瀵掑亣澶搴熶簡锛屾病鍔插涔狅紝娓告垙鐜╄吇锛岀劧鍚庡紑濮嬪彂鍛嗐傚畨闈欎笅鏉ユ椂鎵嶆湁鐏垫劅 锛岀湅鐫绗旇鏈紝灏辨兂鐫鎴戜篃缂栦竴涓數鑴戠郴缁熷惂 /"}, {" \\ /"}, - {" \\ 就想把大一上学到的一些东西总着来练练手。。然后发现写电脑系统就是痴人说梦了,我还是写个模拟计算机吧。 /"}, + {" \\ 灏辨兂鎶婂ぇ涓涓婂鍒扮殑涓浜涗笢瑗挎荤潃鏉ョ粌缁冩墜銆傘傜劧鍚庡彂鐜板啓鐢佃剳绯荤粺灏辨槸鐥翠汉璇存ⅵ浜嗭紝鎴戣繕鏄啓涓ā鎷熻绠楁満鍚с /"}, {" \\ /"}, - {" \\ 对着自己笔记本的键盘一个一个的还原,然后思考如何体现屏幕,如何移动键盘,如何读取键盘把信息传给我的 /"}, + {" \\ 瀵圭潃鑷繁绗旇鏈殑閿洏涓涓竴涓殑杩樺師锛岀劧鍚庢濊冨浣曚綋鐜板睆骞曪紝濡備綍绉诲姩閿洏锛屽浣曡鍙栭敭鐩樻妸淇℃伅浼犵粰鎴戠殑 /"}, {" \\ /"}, - {" \\ 虚拟电脑,如何模拟开机实现基本功能 ,一口气写完真心爽,最后想做互动游戏的,但这斜着的屏幕,emmm /"}, + {" \\ 铏氭嫙鐢佃剳锛屽浣曟ā鎷熷紑鏈哄疄鐜板熀鏈姛鑳 锛屼竴鍙f皵鍐欏畬鐪熷績鐖斤紝鏈鍚庢兂鍋氫簰鍔ㄦ父鎴忕殑锛屼絾杩欐枩鐫鐨勫睆骞曪紝emmm /"}, {" \\ /"}, - {" \\ 所以最后电脑只能运行汉诺塔,其他功能实现也简单,但还是把时间放在我突然又燃起的学习小火苗上吧/"}, - {" \\ └───────────────────────────────────────────────────────────────────────────────────────────┘ /"}, + {" \\ 鎵浠ユ渶鍚庣數鑴戝彧鑳借繍琛屾眽璇哄锛屽叾浠栧姛鑳藉疄鐜颁篃绠鍗曪紝浣嗚繕鏄妸鏃堕棿鏀惧湪鎴戠獊鐒跺張鐕冭捣鐨勫涔犲皬鐏嫍涓婂惂/"}, + {" \\ 鈹斺攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 /"}, {" \\ _____________________________________________________________________________________________ /"}, - {" \\ 开始 \\ qq2010 | 感想.txt | | 12:15 /"}, + {" \\ 寮濮 \\ qq2010 | 鎰熸兂.txt | | 12:15 /"}, {" \\ __________________________________________________________________________________________/"}}; char ending[30][500] = { - {"┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"}, + {"鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, {" \\ An unknown error has occurred with Internet explorer due to low computer configuration /"}, {" \\ /"}, {" \\ If this is the first time you've seen this error on screen. /"}, @@ -174,11 +174,11 @@ char ending[30][500] = { {" \\ Once installed, your old computer might be able to run Internet explorer. That's cool. /"}, {" \\ /"}, {" \\ Technical information: /"}, - {" \\ ****** STOP 0x0000008E (0xc0000005,0xBF856CA8,0xB0F07A40,0x00000000) /"}, + {" \\ ****** STOP 0x0000008E 锛0xc0000005锛0xBF856CA8锛0xB0F07A40锛0x00000000锛 /"}, {" \\ ****** win32k.sys - Address BF853CA8 base at BF800000, DateStamp 5900ef5f /"}, {" \\ __________________________________________________________________________________________/"}}; char map[1000][1000] = { - {"┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"}, + {"鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, {" \\ /"}, {" \\ /"}, {" \\ /"}, @@ -195,32 +195,32 @@ char map[1000][1000] = { {" \\ /"}, {" \\ /"}, {" \\ __________________________________________________________________________________________/"}, - {" ┌──────────────────────────────────────────────────────────────────────────────────────────┐"}, - {" │ ──── │"}, - {" │──────────────────────────────────────────────────────────────────────────────────────────│"}, - {" │┌─────┐ ┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┐ │"}, - {" ││ Esc │ │ F1│ F2│ F3│ F4││ F5│ F6│ F7│ F8││ F9│F10│F11│F12││Prt│Scr│Pau│ ┌┐ ┌┐ ┌┐ ┌┐ │"}, - {" │└─────┘ └───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┘ └┘ └┘ └┘ └┘ │"}, - {" │┌────┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐┌───┬───┬───┐┌───┬───┬───┬───┐│"}, - {" ││ `~ │ 1!│ 2@│ 3#│ 4$│ 5%│ 6^│ 7&│ 8*│ 9(│ 0)│ -─│ =+│ ←--││Ins│Hom│Pgu││Num│ / │ * │ - ││"}, - {" │├────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬────┤├───┼───┼───┤├───┼───┼───┼───┤│"}, - {" ││ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [{│ ]}│ \\| ││Del│End│Pgd││ 7 │ 8 │ 9 │ ││"}, - {" │├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴────┤└───┴───┴───┘├───┼───┼───┤ + ││"}, - {" ││ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ;:│ \'\"│ Enter │ │ 4 │ 5 │ 6 │ ││"}, - {" │├──────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───────┤ ┌───┐ ├───┼───┼───┼───┤│"}, - {" ││ Shift │ Z │ X │ C │ V │ B │ N │ M │ ,<│ .>│ /?│ Shift │ │ ↑│ │ 1 │ 2 │ 3 │ │││"}, - {" │├────┬──┴─┬─┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───╪───┬──────┤┌───┼───┼───┐├───┴───┼───┤ │││"}, - {" ││ Ctr│ win│ Alt│ ──── │ Alt│ Fn│ Ctrl ││← │ ↓│ →││ 0ins │.de│←┘││"}, - {" │└────┴────┴────┴───────────────────────────┴────┴───┴──────┘└───┴───┴───┘└───────┴───┴───┘│"}, - {" │ ┌───────────────────────────────┐ │"}, - {" │ │ │ │"}, - {" │ │ │ │"}, - {" │ │───────────────┬───────────────│ │"}, - {" │ └───────────────┴───────────────┘ │"}, - {" └──────────────────────────────────────────────────────────────────────────────────────────┘"}}; -//功能数组 + {" 鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, + {" 鈹 鈹鈹鈹鈹 鈹"}, + {" 鈹傗攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, + {" 鈹傗攲鈹鈹鈹鈹鈹鈹 鈹屸攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹愨攲鈹鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹愨攲鈹鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹愨攲鈹鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹 鈹"}, + {" 鈹傗攤 Esc 鈹 鈹 F1鈹 F2鈹 F3鈹 F4鈹傗攤 F5鈹 F6鈹 F7鈹 F8鈹傗攤 F9鈹侳10鈹侳11鈹侳12鈹傗攤Prt鈹係cr鈹侾au鈹 鈹屸攼 鈹屸攼 鈹屸攼 鈹屸攼 鈹"}, + {" 鈹傗敂鈹鈹鈹鈹鈹鈹 鈹斺攢鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹樷敂鈹鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹樷敂鈹鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹樷敂鈹鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹 鈹斺敇 鈹斺敇 鈹斺敇 鈹斺敇 鈹"}, + {" 鈹傗攲鈹鈹鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹鈹鈹愨攲鈹鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹愨攲鈹鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹愨攤"}, + {" 鈹傗攤 `~ 鈹 1!鈹 2@鈹 3#鈹 4$鈹 5%鈹 6^鈹 7&鈹 8*鈹 9(鈹 0)鈹 -鈹鈹 =+鈹 鈫--鈹傗攤Ins鈹侶om鈹侾gu鈹傗攤Num鈹 / 鈹 * 鈹 - 鈹傗攤"}, + {" 鈹傗敎鈹鈹鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹鈹鈹も敎鈹鈹鈹鈹尖攢鈹鈹鈹尖攢鈹鈹鈹も敎鈹鈹鈹鈹尖攢鈹鈹鈹尖攢鈹鈹鈹尖攢鈹鈹鈹も攤"}, + {" 鈹傗攤 Tab 鈹 Q 鈹 W 鈹 E 鈹 R 鈹 T 鈹 Y 鈹 U 鈹 I 鈹 O 鈹 P 鈹 [{鈹 ]}鈹 \\| 鈹傗攤Del鈹侲nd鈹侾gd鈹傗攤 7 鈹 8 鈹 9 鈹 鈹傗攤"}, + {" 鈹傗敎鈹鈹鈹鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹攢鈹鈹鈹鈹も敂鈹鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹樷敎鈹鈹鈹鈹尖攢鈹鈹鈹尖攢鈹鈹鈹 + 鈹傗攤"}, + {" 鈹傗攤 Caps 鈹 A 鈹 S 鈹 D 鈹 F 鈹 G 鈹 H 鈹 J 鈹 K 鈹 L 鈹 ;:鈹 \'\"鈹 Enter 鈹 鈹 4 鈹 5 鈹 6 鈹 鈹傗攤"}, + {" 鈹傗敎鈹鈹鈹鈹鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹攢鈹鈹鈹鈹鈹鈹鈹 鈹屸攢鈹鈹鈹 鈹溾攢鈹鈹鈹尖攢鈹鈹鈹尖攢鈹鈹鈹尖攢鈹鈹鈹も攤"}, + {" 鈹傗攤 Shift 鈹 Z 鈹 X 鈹 C 鈹 V 鈹 B 鈹 N 鈹 M 鈹 ,<鈹 .>鈹 /?鈹 Shift 鈹 鈹 鈫戔攤 鈹 1 鈹 2 鈹 3 鈹 鈹傗攤鈹"}, + {" 鈹傗敎鈹鈹鈹鈹鈹攢鈹鈹粹攢鈹攢鈹粹攢鈹鈹敶鈹鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹敶鈹鈹鈹鈺攢鈹鈹鈹攢鈹鈹鈹鈹鈹鈹も攲鈹鈹鈹鈹尖攢鈹鈹鈹尖攢鈹鈹鈹愨敎鈹鈹鈹鈹粹攢鈹鈹鈹尖攢鈹鈹鈹 鈹傗攤鈹"}, + {" 鈹傗攤 Ctr鈹 win鈹 Alt鈹 鈹鈹鈹鈹 鈹 Alt鈹 Fn鈹 Ctrl 鈹傗攤鈫 鈹 鈫撯攤 鈫掆攤鈹 0ins 鈹.de鈹傗啇鈹樷攤鈹"}, + {" 鈹傗敂鈹鈹鈹鈹鈹粹攢鈹鈹鈹鈹粹攢鈹鈹鈹鈹粹攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹粹攢鈹鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹鈹鈹鈹樷敂鈹鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹樷敂鈹鈹鈹鈹鈹鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹樷攤"}, + {" 鈹 鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 鈹"}, + {" 鈹 鈹 鈹 鈹"}, + {" 鈹 鈹 鈹 鈹"}, + {" 鈹 鈹傗攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 鈹"}, + {" 鈹 鈹斺攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹粹攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 鈹"}, + {" 鈹斺攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}}; +//鍔熻兘鏁扮粍 int keyboard[20][30] = { - //把键盘看成一个地图让move函数在上面移动返回的数值对应下面的 board_place[120][5]是对应按键的全部信息 + //鎶婇敭鐩樼湅鎴愪竴涓湴鍥捐move鍑芥暟鍦ㄤ笂闈㈢Щ鍔ㄨ繑鍥炵殑鏁板煎搴斾笅闈㈢殑 board_place[120][5]鏄搴旀寜閿殑鍏ㄩ儴淇℃伅 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 104, 104, 104, 104}, {0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37}, @@ -229,14 +229,14 @@ int keyboard[20][30] = { {0, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 86, 86, 0, 87, 0, 88, 89, 90, 91}, {0, 92, 93, 94, 95, 95, 95, 95, 95, 95, 95, 96, 97, 98, 98, 99, 100, 101, 102, 102, 103, 91}, }; -int next[9][2] = {{0}, {0}, {0}, {0}, {0}, {-1, 0}, {0, -1}, {1, 0}, {0, 1}}; //给键盘传给虚拟键盘的键盘控制虚拟电脑用 -int computer_map[3][8] = {{0, 0, 0, 0, 0}, {0, 1, 2, 3, 4}, {0, 5, 0, 0, 0}}; //对应的移动操作记录 +int next[9][2] = {{0}, {0}, {0}, {0}, {0}, {-1, 0}, {0, -1}, {1, 0}, {0, 1}}; //缁欓敭鐩樹紶缁欒櫄鎷熼敭鐩樼殑閿洏鎺у埗铏氭嫙鐢佃剳鐢 +int computer_map[3][8] = {{0, 0, 0, 0, 0}, {0, 1, 2, 3, 4}, {0, 5, 0, 0, 0}}; //瀵瑰簲鐨勭Щ鍔ㄦ搷浣滆褰 int computer_map_place[6][2] = {{0}, {2, 9}, {2, 19}, {2, 29}, {2, 40}, {6, 12}}; int cx, cy, tcx, tcy, lcx, lcy; -int board_place[120][5] = { //这是按键的信息 下标依次对应 -返回值 -按下shift下的返回值2 -键盘字符长度 -字符坐标x -y - {0, 0, 0, 0, 0}, //第一项如果是字符那么那就是返回字符 如果是数字1-9那么就是功能按键功能对应如下 +int board_place[120][5] = { //杩欐槸鎸夐敭鐨勪俊鎭 涓嬫爣渚濇瀵瑰簲 -杩斿洖鍊 -鎸変笅shift涓嬬殑杩斿洖鍊2 -閿洏瀛楃闀垮害 -瀛楃鍧愭爣x -y + {0, 0, 0, 0, 0}, //绗竴椤瑰鏋滄槸瀛楃閭d箞閭e氨鏄繑鍥炲瓧绗 濡傛灉鏄暟瀛1-9閭d箞灏辨槸鍔熻兘鎸夐敭鍔熻兘瀵瑰簲濡備笅 {1, 1, 3, 21, 19}, //1-10 - {0, 0, 2, 21, 28}, //1 ~ 返回 2 ~删除 3确认 4shift 5上 6左 7下 8又 9开机 + {0, 0, 2, 21, 28}, //1 ~ 杩斿洖 2 ~鍒犻櫎 3纭 4shift 5涓 6宸 7涓 8鍙 9寮鏈 {0, 0, 2, 21, 32}, {0, 0, 2, 21, 36}, {0, 0, 2, 21, 40}, @@ -340,25 +340,25 @@ int board_place[120][5] = { // {'.', '.', 4, 32, 99}, {9, 9, 4, 18, 99}}; -// 程序功能变量 -int flag, function, if_shift, if_start, if_input_password, if_into_desktop, if_game, qpz; //0表示输入无效,1表示是输入电脑键 2表示是功能键 +// 绋嬪簭鍔熻兘鍙橀噺 +int flag, function, if_shift, if_start, if_input_password, if_into_desktop, if_game, qpz; //0琛ㄧず杈撳叆鏃犳晥锛1琛ㄧず鏄緭鍏ョ數鑴戦敭 2琛ㄧず鏄姛鑳介敭 char letter; int x, y, tx, ty, num, lx, ly; char temp[6] = {"====="}; char put_in_computer[20]; -char password_0[20] = {"WHJY"}; // 密码 +char password_0[20] = {"WHJY"}; // 瀵嗙爜 int put_in_num, if_input, input_x, input_y, input_max; -// 汉诺塔游戏变量 +// 姹夎濉旀父鎴忓彉閲 int mid_x, mid_y; int len, width, left, mid, right, time; int ttx, tty; char game_map[80][1000]; -int game_next[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; //上0下1左2右3; +int game_next[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; //涓0涓1宸2鍙3锛 -int turn[2][3] = {{0, 3, 1}, //a -> b b -> c a -> c 上右下 - {0, 2, 1}}; //b -> a c -> b c -> a 上左下 //实现自动移动的路线储存 +int turn[2][3] = {{0, 3, 1}, //a -> b b -> c a -> c 涓婂彸涓 + {0, 2, 1}}; //b -> a c -> b c -> a 涓婂乏涓 //瀹炵幇鑷姩绉诲姩鐨勮矾绾垮偍瀛 -//打砖块游戏变量 +//鎵撶爾鍧楁父鎴忓彉閲 char map2[1000][1000]; char End[20][50] = { {" ## ## ## "}, @@ -375,11 +375,11 @@ char End[20][50] = { {"###### ####### ### ## ### "}, {"### ####### ## ## ## "}, {" ## ## ## "}, - {" 按 任 意 键 继 续 "}, + {" 鎸 浠 鎰 閿 缁 缁 "}, }; //----------------------------------------------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------------------------------------------- -//此处是人工地图接口(开启请前往main函数里面设置下面0为1并且自己改变图案) +//姝ゅ鏄汉宸ュ湴鍥炬帴鍙o紙寮鍚鍓嶅線main鍑芥暟閲岄潰璁剧疆涓嬮潰0涓1骞朵笖鑷繁鏀瑰彉鍥炬锛 int if_my_map; char my_map[50][500] = {{"#############################################################################################################################"}, {"## life: | | | ##"}, @@ -398,36 +398,36 @@ char my_map[50][500] = {{"###################################################### {"############### ###############"}, {"################ ########### ################"}, {"#############################################################################################################################"}}; -//修改规则: -//显然电脑屏幕外是不能动的只能修改里面梯形 -// 墙~# 砖块~0 空气~' ' -//小球在倒数第七行 23~27列之间随机生成,不能占位 -//左下角是木板生成地,左上是生命 不可改(要改需调参数) +//淇敼瑙勫垯锛 +//鏄剧劧鐢佃剳灞忓箷澶栨槸涓嶈兘鍔ㄧ殑鍙兘淇敼閲岄潰姊舰 +// 澧檦# 鐮栧潡~0 绌烘皵~' ' +//灏忕悆鍦ㄥ掓暟绗竷琛 23~27鍒椾箣闂撮殢鏈虹敓鎴愶紝涓嶈兘鍗犱綅 +//宸︿笅瑙掓槸鏈ㄦ澘鐢熸垚鍦帮紝宸︿笂鏄敓鍛 涓嶅彲鏀癸紙瑕佹敼闇璋冨弬鏁帮級 //----------------------------------------------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------------------------------------------- -//全局变量区,在init里面改变 +//鍏ㄥ眬鍙橀噺鍖猴紝鍦╥nit閲岄潰鏀瑰彉 char wall, food, air, brick; int width2, length2; -double X2, Y2, x2, y2, Vx, Vy, t2, V; //默认向下向右为正 +double X2, Y2, x2, y2, Vx, Vy, t2, V; //榛樿鍚戜笅鍚戝彸涓烘 int old_x2, old_y2, head2, tail2, max2, step2, if_miss, food_num, goal, color, add_x, add_y, cnt; -int if_load_snake_mod, debug, life; //debug模式调成1手动开启 -int temp_x2, temp_y2, menu_x, menu_y, left2, right2; //临时坐标 -double C[8] = {0, 10, 30, 55, 90}; //初始斜抛的角度,自右向上转角(目前已调整好最好的角度) +int if_load_snake_mod, debug, life; //debug妯″紡璋冩垚1鎵嬪姩寮鍚 +int temp_x2, temp_y2, menu_x, menu_y, left2, right2; //涓存椂鍧愭爣 +double C[8] = {0, 10, 30, 55, 90}; //鍒濆鏂滄姏鐨勮搴︼紝鑷彸鍚戜笂杞(鐩墠宸茶皟鏁村ソ鏈濂界殑瑙掑害) -struct Step //轨迹 +struct Step //杞ㄨ抗 { int x2; int y2; } s[1000]; -void HideCursor() //光标隐藏 +void HideCursor() //鍏夋爣闅愯棌 { - CONSOLE_CURSOR_INFO cursor_info = {1, 0}; //后边的0代表光标不可见 + CONSOLE_CURSOR_INFO cursor_info = {1, 0}; //鍚庤竟鐨0浠h〃鍏夋爣涓嶅彲瑙 SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info); } -void gotoxy(int x, int y) //坐标函数 +void gotoxy(int x, int y) //鍧愭爣鍑芥暟 { HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); COORD pos; @@ -436,7 +436,7 @@ void gotoxy(int x, int y) // SetConsoleCursorPosition(handle, pos); } void init_game(int n) -{ //初始化汉诺塔 +{ //鍒濆鍖栨眽璇哄 int i, j; mid_x = 7, mid_y = 60; ttx = 10, tty = 10; @@ -458,12 +458,12 @@ void init_game(int n) if (num && (i >= 1 && i <= width - 1) && j % 2 != 0 && j < mid) { game_map[i][j] = -95; - game_map[i][j + 1] = -10; //打印 ■ ■占2个字节可以拆开来 + game_map[i][j + 1] = -10; //鎵撳嵃 鈻 鈻犲崰2涓瓧鑺傚彲浠ユ媶寮鏉 num--; } } } - //容易出现东西卡顿 + //瀹规槗鍑虹幇涓滆タ鍗¢】 for (i = 0; i <= width; i++) { gotoxy(tty, ttx + i); @@ -474,14 +474,14 @@ void init_game(int n) } void play(int x, int y) -{ //显示汉诺塔移动轨迹 +{ //鏄剧ず姹夎濉旂Щ鍔ㄨ建杩 int turn_0, n = 0, i, j, k, tx, ty, flag = 0; if ((x == mid && y == right) || (x == left && y == mid) || (x == left && y == right)) - turn_0 = 0; //往右 + turn_0 = 0; //寰鍙 else if ((x == mid && y == left) || (x == right && y == left) || (x == right && y == mid)) - turn_0 = 1; //往左 + turn_0 = 1; //寰宸 for (i = 1, j = y; i <= width; i++) - { //目的地 + { //鐩殑鍦 if (game_map[i][j] != 0) { tx = i - 1; @@ -490,7 +490,7 @@ void play(int x, int y) } } for (i = 1, j = x; i <= width; i++) - { //出发点 + { //鍑哄彂鐐 if (game_map[i][j] != 0) { break; @@ -527,7 +527,7 @@ void play(int x, int y) printf("%c", game_map[i][j + k]); } } - n++; //改变方向; + n++; //鏀瑰彉鏂瑰悜; if (i == tx && j == ty) return; if (turn_0 == 0) @@ -558,7 +558,7 @@ void play(int x, int y) } void move_hnt(int a, int b, int c, char aa, char bb, char cc, int n) -{ //正常的汉诺塔递归程序 +{ //姝e父鐨勬眽璇哄閫掑綊绋嬪簭 if (n == 1) { //printf("from %c to %c",aa,cc); @@ -573,9 +573,9 @@ void move_hnt(int a, int b, int c, char aa, char bb, char cc, int n) } void init() { - int i, j, k; //初始化整个程序 + int i, j, k; //鍒濆鍖栨暣涓▼搴 char ch; - HideCursor(); //决定是否开启光标隐藏 + HideCursor(); //鍐冲畾鏄惁寮鍚厜鏍囬殣钘 cx = 1, cy = 1; lcx = cx, lcy = cy; mid_x = 7, mid_y = 60; @@ -583,34 +583,34 @@ void init() flag = 0, function, if_shift = 0, if_start = 0, if_input_password = 0, if_into_desktop = 0, if_game = 0; put_in_num = 0, if_input = 0; system("mode con cols=125 lines=60"); - printf("【程序信息】:\n"); - printf(" 程序名称:模拟笔记本电脑\n"); - printf(" 程序作者:404name\n"); - printf(" 完成时间:2020.2.01\n"); - printf(" 最后更新:2020.4.07\n"); - printf(" 项目地址:https://github.com/404name/winter (有问题可以去联系我)\n\n"); - printf("【更新记录】(2020)\n"); - printf(" 3.10 修复bug:不同平台显示乱码\n"); - printf(" 3.15 修复bug:关机仍能输入密码\n"); - printf(" 3.15 优化体验:加入光标隐藏(关闭前往init函数第一行)\n"); - printf(" 3.19 完善功能:加入可移动游戏简洁版,可自制地图,方法前往源程序my_map数组处查看\n"); - printf(" 4.07 完善功能:(桌面软件全部更新,功能完善,更加贴近xp系统。)\n"); - printf(" ·密码输入优化,输入的密码会在下一次输入变成不可视。\n"); - printf(" ·优化打砖块对角碰撞算法,更加真实。\n"); - printf(" ·新增“此电脑”可查看电脑配置.\n"); - printf(" ·新增关机画面。\n"); - printf(" ·加入蓝屏,更加快乐(点击浏览器触发)\n"); - printf(" ·优化更多细节.\n\n"); - printf("【程序补充】\n"); - printf(" ·这里差不多把坑填完了,之前反应的要有能操控的游戏,输入密码可见不真实,关机画面没模拟等等\n"); - printf(" ·都弄完了,至于网上冲浪,打lol,写编译器就有生之年吧。对了,因此我还特意加入了蓝屏(滑稽)。\n\n"); - printf("【程序说明】\n"); - printf(" ·有问题,有bug,不兼容,欢迎去git反馈交流\n"); - printf(" ·操作方法:↑ ↓ ← → 空格 控制光标即可。\n"); - printf(" ·进入程序电源键处按一次空格||输入密码WHJY即可登录||请在虚拟键盘上开启大写再输入||\n"); - printf(" ·欢迎使用XP模拟笔记本电脑!\n"); - printf(" 1.按两下回车进入(未能解决bug:移动时周围可能会有蓝色的闪频)\n"); - printf(" 2.按1再按回车进入 (开启清除闪频,但光标背景变成透明,不好鉴别)\n"); + printf("銆愮▼搴忎俊鎭戯細\n"); + printf(" 绋嬪簭鍚嶇О锛氭ā鎷熺瑪璁版湰鐢佃剳\n"); + printf(" 绋嬪簭浣滆咃細404name\n"); + printf(" 瀹屾垚鏃堕棿锛2020.2.01\n"); + printf(" 鏈鍚庢洿鏂帮細2020.4.07\n"); + printf(" 椤圭洰鍦板潃锛歨ttps://github.com/404name/winter 锛堟湁闂鍙互鍘昏仈绯绘垜锛塡n\n"); + printf("銆愭洿鏂拌褰曘戯紙2020锛塡n"); + printf(" 3.10 淇bug锛氫笉鍚屽钩鍙版樉绀轰贡鐮乗n"); + printf(" 3.15 淇bug锛氬叧鏈轰粛鑳借緭鍏ュ瘑鐮乗n"); + printf(" 3.15 浼樺寲浣撻獙锛氬姞鍏ュ厜鏍囬殣钘忥紙鍏抽棴鍓嶅線init鍑芥暟绗竴琛岋級\n"); + printf(" 3.19 瀹屽杽鍔熻兘锛氬姞鍏ュ彲绉诲姩娓告垙绠娲佺増锛屽彲鑷埗鍦板浘锛屾柟娉曞墠寰婧愮▼搴弇y_map鏁扮粍澶勬煡鐪媆n"); + printf(" 4.07 瀹屽杽鍔熻兘锛氾紙妗岄潰杞欢鍏ㄩ儴鏇存柊锛屽姛鑳藉畬鍠勶紝鏇村姞璐磋繎xp绯荤粺銆傦級\n"); + printf(" 路瀵嗙爜杈撳叆浼樺寲锛岃緭鍏ョ殑瀵嗙爜浼氬湪涓嬩竴娆¤緭鍏ュ彉鎴愪笉鍙銆俓n"); + printf(" 路浼樺寲鎵撶爾鍧楀瑙掔鎾炵畻娉曪紝鏇村姞鐪熷疄銆俓n"); + printf(" 路鏂板鈥滄鐢佃剳鈥濆彲鏌ョ湅鐢佃剳閰嶇疆.\n"); + printf(" 路鏂板鍏虫満鐢婚潰銆俓n"); + printf(" 路鍔犲叆钃濆睆锛屾洿鍔犲揩涔愶紙鐐瑰嚮娴忚鍣ㄨЕ鍙戯級\n"); + printf(" 路浼樺寲鏇村缁嗚妭.\n\n"); + printf("銆愮▼搴忚ˉ鍏呫慭n"); + printf(" 路杩欓噷宸笉澶氭妸鍧戝~瀹屼簡锛屼箣鍓嶅弽搴旂殑瑕佹湁鑳芥搷鎺х殑娓告垙锛岃緭鍏ュ瘑鐮佸彲瑙佷笉鐪熷疄锛屽叧鏈虹敾闈㈡病妯℃嫙绛夌瓑\n"); + printf(" 路閮藉紕瀹屼簡锛岃嚦浜庣綉涓婂啿娴紝鎵搇ol锛屽啓缂栬瘧鍣ㄥ氨鏈夌敓涔嬪勾鍚с傚浜嗭紝鍥犳鎴戣繕鐗规剰鍔犲叆浜嗚摑灞忥紙婊戠ń锛夈俓n\n"); + printf("銆愮▼搴忚鏄庛慭n"); + printf(" 路鏈夐棶棰橈紝鏈塨ug锛屼笉鍏煎锛屾杩庡幓git鍙嶉浜ゆ祦\n"); + printf(" 路鎿嶄綔鏂规硶锛氣啈 鈫 鈫 鈫 绌烘牸 鎺у埗鍏夋爣鍗冲彲銆俓n"); + printf(" 路杩涘叆绋嬪簭鐢垫簮閿鎸変竴娆$┖鏍紎|杈撳叆瀵嗙爜WHJY鍗冲彲鐧诲綍||璇峰湪铏氭嫙閿洏涓婂紑鍚ぇ鍐欏啀杈撳叆||\n"); + printf(" 路娆㈣繋浣跨敤XP妯℃嫙绗旇鏈數鑴戯紒\n"); + printf(" 1.鎸変袱涓嬪洖杞﹁繘鍏ワ紙鏈兘瑙e喅bug:绉诲姩鏃跺懆鍥村彲鑳戒細鏈夎摑鑹茬殑闂锛塡n"); + printf(" 2.鎸1鍐嶆寜鍥炶溅杩涘叆 锛堝紑鍚竻闄ら棯棰戯紝浣嗗厜鏍囪儗鏅彉鎴愰忔槑锛屼笉濂介壌鍒級\n"); ch = getchar(); getchar(); if (ch == '1') @@ -636,7 +636,7 @@ void init() } void init_start() -{ // 开机 + 动态加载页面 + 打开输入密码权限 +{ // 寮鏈 + 鍔ㄦ佸姞杞介〉闈 + 鎵撳紑杈撳叆瀵嗙爜鏉冮檺 int i, l, j; gotoxy(0, 0); for (i = 0; i <= 16; i++) @@ -646,7 +646,7 @@ void init_start() } for (l = 0; l < 3; l++) - { //动态加载 + { //鍔ㄦ佸姞杞 for (i = 53; i <= 71; i = i + 2) { for (j = i - 4; j <= i; j = j + 2) @@ -674,13 +674,13 @@ void init_start() printf("%s\n", password[i]); Sleep(10); } - if_input = 1; // 9 77 18个 + if_input = 1; // 9 77 18涓 input_x = 9; input_y = 77; input_max = 18; } void load_desktop() -{ //加载桌面 +{ //鍔犺浇妗岄潰 int i; cx = 1, cy = 1; if_into_desktop = 1; @@ -694,12 +694,12 @@ void load_desktop() } } void end() -{ //加载关机 +{ //鍔犺浇鍏虫満 int i; system("color 70"); - //Windows 正在关机... - char temp1[30] = {"│ 正在注销.... │"}; - char temp2[30] = {"│ Windows 正在关机...│"}; + //Windows 姝e湪鍏虫満... + char temp1[30] = {"鈹 姝e湪娉ㄩ攢.... 鈹"}; + char temp2[30] = {"鈹 Windows 姝e湪鍏虫満...鈹"}; gotoxy(0, 0); if_input = 0; gotoxy(0, 0); @@ -721,14 +721,14 @@ void end() Sleep(10); } } -void blue_screen() //蓝屏 +void blue_screen() //钃濆睆 { int i, j, l = 2, r = 122, hei = 16, len = 124; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 30); gotoxy(0, 0); if_into_desktop = 0; for (i = 1; i <= hei; i++) - { //打印地图 + { //鎵撳嵃鍦板浘 for (j = 0; j <= len; j++) { if (j >= l && j <= r) @@ -770,7 +770,7 @@ void my_computer() } void load_more() -{ //更多信息 +{ //鏇村淇℃伅 int i; gotoxy(0, 0); @@ -782,7 +782,7 @@ void load_more() } } void load_game() -{ //加载汉诺塔程序 +{ //鍔犺浇姹夎濉旂▼搴 int i; if_into_desktop = 0; gotoxy(0, 0); @@ -794,14 +794,14 @@ void load_game() } if_game = 1; gotoxy(mid_y - 16, mid_x); - printf("请输入你要递归的汉诺塔数目_"); + printf("璇疯緭鍏ヤ綘瑕侀掑綊鐨勬眽璇哄鏁扮洰_"); input_x = mid_x; input_y = mid_y - 16 + 27; input_max = 1; if_input = 1; } int move() -{ //控制虚拟键盘的指针移动函数 +{ //鎺у埗铏氭嫙閿洏鐨勬寚閽堢Щ鍔ㄥ嚱鏁 int i, k, flag = 1; char ch, ch1, ch2; while (ch != ' ') @@ -813,7 +813,7 @@ int move() continue; lx = x, ly = y; if (ch == -32) - { //同时启用wasd 和上下左右键 //如果读取到第一个是-32那么 继续读取一个字符 + { //鍚屾椂鍚敤wasd 鍜屼笂涓嬪乏鍙抽敭 //濡傛灉璇诲彇鍒扮涓涓槸-32閭d箞 缁х画璇诲彇涓涓瓧绗 ch1 = getch(); switch (ch1) { @@ -900,7 +900,7 @@ int move() } } -//----------------------------------------------------------------------------打砖块/----------------------------------------------------------------------------- +//----------------------------------------------------------------------------鎵撶爾鍧/----------------------------------------------------------------------------- void init_brick() { int l, r, i, j, a, b; @@ -910,8 +910,8 @@ void init_brick() width2 = 16, length2 = 124; wall = '#', food = '*', air = ' ', brick = 'O'; head2 = 0, tail2 = 0, max2 = 20, step2 = 0, if_miss = 0, food_num = 400, goal = 0, color = 0; - debug = 0, life = 3; //debug模式调成1手动开启 - temp_x2 = 2, temp_y2 = 2, menu_x = 18, menu_y = 68, left2 = 25, right2 = 35; //临时坐标 + debug = 0, life = 3; //debug妯″紡璋冩垚1鎵嬪姩寮鍚 + temp_x2 = 2, temp_y2 = 2, menu_x = 18, menu_y = 68, left2 = 25, right2 = 35; //涓存椂鍧愭爣 gotoxy(0, 0); memset(s, 0, sizeof(s)); r = length2; @@ -919,7 +919,7 @@ void init_brick() if (if_my_map == 0) { for (i = 0; i <= width2; i++) - { //生成地图模板 + { //鐢熸垚鍦板浘妯℃澘 for (j = 0; j <= length2; j++) { if (i == 0 || i == width2) @@ -940,7 +940,7 @@ void init_brick() { food_num = 400; while (food_num--) - { //贪吃蛇生成食物 + { //璐悆铔囩敓鎴愰鐗 a = rand() % width2; b = rand() % length2; if ((a >= width2 / 3 && a <= width2 * 2 / 3) && (b >= length2 * 2 / 5 && b <= length2 * 3 / 5) || a == 0 || b == 0) @@ -949,7 +949,7 @@ void init_brick() } } for (i = 0; i <= width2; i++) - { //布置砖块brick + { //甯冪疆鐮栧潡brick for (j = 0; j <= length2; j++) { if (((i >= width2 * 2 / 3 && i <= width2 * 2 / 3 + 1) && (j >= 0 && j <= length2 / 5)) || ((i >= width2 * 2 / 3 && i <= width2 * 2 / 3 + 1) && (j >= length2 * 4 / 5 && j <= length2))) @@ -970,7 +970,7 @@ void init_brick() l = 0; gotoxy(0, 0); for (i = 0; i <= width2; i++) - { //打印地图 + { //鎵撳嵃鍦板浘 for (j = 0; j <= length2; j++) { if (j >= l && j <= r) @@ -987,7 +987,7 @@ void init_brick() Sleep(50); printf("\n"); } - //构建初始位置以及速度和方向角度 + //鏋勫缓鍒濆浣嶇疆浠ュ強閫熷害鍜屾柟鍚戣搴 X2 = width2 - 6; Y2 = rand() % 5 + 23; old_x2 = (int)X2; @@ -995,13 +995,13 @@ void init_brick() s[step2].x2 = old_x2; s[step2].y2 = old_y2; V = 15; - Vx = -V * sin(C[3] * pi / 180.0); //速度向右向下为正方向 + Vx = -V * sin(C[3] * pi / 180.0); //閫熷害鍚戝彸鍚戜笅涓烘鏂瑰悜 Vy = V * cos(C[3] * pi / 180.0); gotoxy(4, 1); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); printf("life:"); for (i = 0; i < life; i++) - printf("■"); + printf("鈻"); } void end_brick() @@ -1017,7 +1017,7 @@ void end_brick() step2 += max2; gotoxy(s[step2].y2, s[step2].x2); map2[s[step2].x2][s[step2].y2]--; - if (map2[s[step2].x2][s[step2].y2] == air && !(s[step2].x2 == 0 && s[step2].y2 == 0)) //防止自己吃自己 + if (map2[s[step2].x2][s[step2].y2] == air && !(s[step2].x2 == 0 && s[step2].y2 == 0)) //闃叉鑷繁鍚冭嚜宸 printf("%c", air); s[step2].x2 = 0; s[step2].y2 = 0; @@ -1039,9 +1039,9 @@ void end_brick() if_into_desktop = 1; } -void manchange(char ch) //人为输入更新 +void manchange(char ch) //浜轰负杈撳叆鏇存柊 { - if (ch == 'a' || ch == 's' || ch == 'd' || ch == 'w' || ch == ' ' || ch == 'p' || ch == 'b') //目前只开放aswd + if (ch == 'a' || ch == 's' || ch == 'd' || ch == 'w' || ch == ' ' || ch == 'p' || ch == 'b') //鐩墠鍙紑鏀綼swd { if (ch == 'a' && map2[width2 - 1][left2 - 1] != wall) { @@ -1071,7 +1071,7 @@ void manchange(char ch) // else if (ch == 'p') { /*gotoxy(2, width2 + 5); - printf("游戏暂停,按'p'继续游戏"); + printf("娓告垙鏆傚仠锛屾寜'p'缁х画娓告垙"); ch2 = getch(); while (ch2 != 'p') { @@ -1088,7 +1088,7 @@ void manchange(char ch) // //function = move(&temp_x2,&temp_y2,0,width2,0,length2,1,1,ch); //function = move(&menu_x,&menu_y,18,24,68,68,2,0,ch); } -void autochange() //自动更新 +void autochange() //鑷姩鏇存柊 { int flag = 1, i; double t1, t2; @@ -1098,50 +1098,50 @@ void autochange() // double x2_t1; double x3_t1; double x4_t1; - //更具体请前往https://github.com/404name/winter 打砖块子目录下下载demo文件参考抛物线原理 - //这里的“轨迹”是存在“循环队列”的结构体中的 - //map数组一开始只打印一次,随后在原数组上的改变不会作用显示。 - //显示轨迹的其实还是打印空格,但不同的是颜色 - //消去轨迹也打印白色的空格:SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); + //鏇村叿浣撹鍓嶅線https://github.com/404name/winter 鎵撶爾鍧楀瓙鐩綍涓嬩笅杞絛emo鏂囦欢鍙傝冩姏鐗╃嚎鍘熺悊 + //杩欓噷鐨勨滆建杩光濇槸瀛樺湪鈥滃惊鐜槦鍒椻濈殑缁撴瀯浣撲腑鐨 + //map鏁扮粍涓寮濮嬪彧鎵撳嵃涓娆★紝闅忓悗鍦ㄥ師鏁扮粍涓婄殑鏀瑰彉涓嶄細浣滅敤鏄剧ず銆 + //鏄剧ず杞ㄨ抗鐨勫叾瀹炶繕鏄墦鍗扮┖鏍硷紝浣嗕笉鍚岀殑鏄鑹 + //娑堝幓杞ㄨ抗涔熸墦鍗扮櫧鑹茬殑绌烘牸锛歋etConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); /*------------------------------------------------------- - 核心公式: X = X0 + Vx * t + 1/2 * VX * t * t; + 鏍稿績鍏紡锛 X = X0 + Vx * t + 1/2 * VX * t * t; Y = Y0 + Vy * t; - 核心思想: ·如果选择时间作为移动参考,则每秒会出现点相差太远 - 难以实现连续。 - ·这里反过来,以连续为前提,尝试找出每移动一个单位 - 需要多少时间,则能依次找出一个连续的曲线。 + 鏍稿績鎬濇兂锛 路濡傛灉閫夋嫨鏃堕棿浣滀负绉诲姩鍙傝冿紝鍒欐瘡绉掍細鍑虹幇鐐圭浉宸お杩 + 闅句互瀹炵幇杩炵画銆 + 路杩欓噷鍙嶈繃鏉ワ紝浠ヨ繛缁负鍓嶆彁锛屽皾璇曟壘鍑烘瘡绉诲姩涓涓崟浣 + 闇瑕佸灏戞椂闂达紝鍒欒兘渚濇鎵惧嚭涓涓繛缁殑鏇茬嚎銆 - 出现问题: c语言数组只能是整数,所以移动方向只能存在水平和竖直, - 不能依照运动方向实现往某个特定的角度移动一个单位。 - 并且要排除断节问题(即打印的曲线断断续续) + 鍑虹幇闂锛 c璇█鏁扮粍鍙兘鏄暣鏁帮紝鎵浠ョЩ鍔ㄦ柟鍚戝彧鑳藉瓨鍦ㄦ按骞冲拰绔栫洿锛 + 涓嶈兘渚濈収杩愬姩鏂瑰悜瀹炵幇寰鏌愪釜鐗瑰畾鐨勮搴︾Щ鍔ㄤ竴涓崟浣嶃 + 骞朵笖瑕佹帓闄ゆ柇鑺傞棶棰橈紙鍗虫墦鍗扮殑鏇茬嚎鏂柇缁画锛 - 解决方法: 把特移动方向移动单位分解到X,Y上。 - 分别算出 X 增加一个单位长度 应该增加的 Y 的距离 s1 <=> flag == 1 - Y 增加一个单位长度 应该增加的 X 的距离 s2 <=> flag == 2 + 瑙e喅鏂规硶锛 鎶婄壒绉诲姩鏂瑰悜绉诲姩鍗曚綅鍒嗚В鍒癤锛孻涓娿 + 鍒嗗埆绠楀嚭 X 澧炲姞涓涓崟浣嶉暱搴 搴旇澧炲姞鐨 Y 鐨勮窛绂 s1 <=> flag == 1 + Y 澧炲姞涓涓崟浣嶉暱搴 搴旇澧炲姞鐨 X 鐨勮窛绂 s2 <=> flag == 2 - 优先选择更短的min(s1,s2),然后以flag对应不同的模式作为下一次移动的基准。 - 这样操作能保证线段仅仅只在水平与竖直方向移动时线段仍能连续 + 浼樺厛閫夋嫨鏇寸煭鐨刴in锛坰1,s2),鐒跺悗浠lag瀵瑰簲涓嶅悓鐨勬ā寮忎綔涓轰笅涓娆$Щ鍔ㄧ殑鍩哄噯銆 + 杩欐牱鎿嶄綔鑳戒繚璇佺嚎娈典粎浠呭彧鍦ㄦ按骞充笌绔栫洿鏂瑰悜绉诲姩鏃剁嚎娈典粛鑳借繛缁 - 打个比方:一段斜率为2的直线 - x增加1 Y增加2你看,这里Y脱节了会一下子在Y上移动了2格。 - 但实际上我们看 - Y增加1 X实际上只增加0.5. - 所以一段曲线,他的微元构成的直线不管斜率多偏僻,都能连续打印。 - 这就是为什么取min(s1,s2)决定移动模式的原因。 - 这样能保证仅仅只在上移动一个单位int(Y),而int(X)是不增加的,浮点型的X又把量累计到下一次在判断。 + 鎵撲釜姣旀柟锛氫竴娈垫枩鐜囦负2鐨勭洿绾 + x澧炲姞1 Y澧炲姞2浣犵湅锛岃繖閲孻鑴辫妭浜嗕細涓涓嬪瓙鍦╕涓婄Щ鍔ㄤ簡2鏍笺 + 浣嗗疄闄呬笂鎴戜滑鐪 + Y澧炲姞1 X瀹為檯涓婂彧澧炲姞0.5. + 鎵浠ヤ竴娈垫洸绾匡紝浠栫殑寰厓鏋勬垚鐨勭洿绾夸笉绠℃枩鐜囧鍋忓兓锛岄兘鑳借繛缁墦鍗般 + 杩欏氨鏄负浠涔堝彇min锛坰1,s2锛夊喅瀹氱Щ鍔ㄦā寮忕殑鍘熷洜銆 + 杩欐牱鑳戒繚璇佷粎浠呭彧鍦ㄤ笂绉诲姩涓涓崟浣峣nt锛圷锛夛紝鑰宨nt锛圶锛夋槸涓嶅鍔犵殑锛屾诞鐐瑰瀷鐨刋鍙堟妸閲忕疮璁″埌涓嬩竴娆″湪鍒ゆ柇銆 - 最后实现: - X,Y用double储存,保证实际叠加能连续; - 而实际打印,是不能说(5,6.28)这样的浮点型能在c语言上打印,所以我们采用int整型的old_x,old_y来承接X,Y以便于打印在屏幕上。 + 鏈鍚庡疄鐜帮細 + X锛孻鐢╠ouble鍌ㄥ瓨锛屼繚璇佸疄闄呭彔鍔犺兘杩炵画锛 + 鑰屽疄闄呮墦鍗帮紝鏄笉鑳借锛5,6.28锛夎繖鏍风殑娴偣鍨嬭兘鍦╟璇█涓婃墦鍗帮紝鎵浠ユ垜浠噰鐢╥nt鏁村瀷鐨刼ld_x,old_y鏉ユ壙鎺锛孻浠ヤ究浜庢墦鍗板湪灞忓箷涓娿 - 我们按照时间为循环只能在屏幕上打印一串断断续续的类抛物线的点。 - 但我们按照走一个“方向单位”,依次类叠,我们就能得到一串连续的线。 + 鎴戜滑鎸夌収鏃堕棿涓哄惊鐜彧鑳藉湪灞忓箷涓婃墦鍗颁竴涓叉柇鏂画缁殑绫绘姏鐗╃嚎鐨勭偣銆 + 浣嗘垜浠寜鐓ц蛋涓涓滄柟鍚戝崟浣嶁濓紝渚濇绫诲彔锛屾垜浠氨鑳藉緱鍒颁竴涓茶繛缁殑绾裤 - 结果实现: 由于,算法偏向不严谨,可能会出现小部分开局断节bug,但随着循环推迟,后期能100%连续!! + 缁撴灉瀹炵幇锛 鐢变簬锛岀畻娉曞亸鍚戜笉涓ヨ皑锛屽彲鑳戒細鍑虹幇灏忛儴鍒嗗紑灞鏂妭bug锛屼絾闅忕潃寰幆鎺ㄨ繜锛屽悗鏈熻兘100%杩炵画锛侊紒 - 加入人为修正 + 鍔犲叆浜轰负淇 - 经测试小范围的数据能完美打印出物理抛物线!!! + 缁忔祴璇曞皬鑼冨洿鐨勬暟鎹兘瀹岀編鎵撳嵃鍑虹墿鐞嗘姏鐗╃嚎锛侊紒锛 ------------------------------------------------------------*/ x1_t1 = (-Vx + sqrt(Vx * Vx + 20)) / 10; @@ -1160,7 +1160,7 @@ void autochange() // temp = 10; t1 = t1 < temp ? t1 : temp; s1 = t1 * Vy; - //当Y2增加一个单位方向时 + //褰揧2澧炲姞涓涓崟浣嶆柟鍚戞椂 t2 = 1.0 / fabs(Vy); s2 = Vx * t2 + 0.5 * g * t2 * t2; if ((int)s1 == 0) @@ -1170,7 +1170,7 @@ void autochange() // else flag = s1 < s2 ? 1 : 2; - //选择最优进行处理 + //閫夋嫨鏈浼樿繘琛屽鐞 if (flag == 1) { X2 = X2 + Vx * t1 + 5 * t1 * t1; @@ -1185,14 +1185,14 @@ void autochange() // } /*else{ for( i = 0; i < 4; i++) - 放弃判断对角了选择其他方式解决(详细见开头注释) + 鏀惧純鍒ゆ柇瀵硅浜嗛夋嫨鍏朵粬鏂瑰紡瑙e喅锛堣缁嗚寮澶存敞閲婏級 } } */ //--------------------------------- old_x2 = (int)X2; old_y2 = (int)Y2; - //常规的判断碰撞 + //甯歌鐨勫垽鏂鎾 if (map2[old_x2 + 1][old_y2] == wall && Vx >= 0 && map2[old_x2][old_y2 + 1] != wall && map2[old_x2][old_y2 - 1] != wall) { color = (color + 1) % 5; @@ -1269,7 +1269,7 @@ void autochange() // } else if (map2[old_x2 + 1][old_y2 + 1] == brick && Vx > 0 && Vy > 0 || map2[old_x2 + 1][old_y2 - 1] == brick && Vx > 0 && Vy < 0 || map2[old_x2 - 1][old_y2 + 1] == brick && Vx < 0 && Vy > 0 || map2[old_x2 - 1][old_y2 - 1] == brick && Vx < 0 && Vy < 0) { - color = (color + 1) % 5; //对角碰改变颜色方便区分 + color = (color + 1) % 5; //瀵硅纰版敼鍙橀鑹叉柟渚垮尯鍒 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); if (Vx > 0 && Vy > 0) { @@ -1322,7 +1322,7 @@ void autochange() // SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); gotoxy(s[step2].y2, s[step2].x2); map2[s[step2].x2][s[step2].y2]--; - if (map2[s[step2].x2][s[step2].y2] == air && !(s[step2].x2 == 0 && s[step2].y2 == 0)) //防止自己吃自己 + if (map2[s[step2].x2][s[step2].y2] == air && !(s[step2].x2 == 0 && s[step2].y2 == 0)) //闃叉鑷繁鍚冭嚜宸 printf("%c", air); } s[step2].x2 = old_x2; @@ -1336,19 +1336,19 @@ void autochange() // { case 0: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 60); - break; //蓝色 + break; //钃濊壊 case 1: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 70); - break; //红色 + break; //绾㈣壊 case 2: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 40); - break; //绿色 + break; //缁胯壊 case 3: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 30); - break; //深蓝色 + break; //娣辫摑鑹 case 4: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 128); - break; //紫色 + break; //绱壊 } gotoxy(s[step2].y2, s[step2].x2); if (map2[s[step2].x2][s[step2].y2] == brick) @@ -1359,7 +1359,7 @@ void autochange() // if (debug == 0 && !(s[step2].x2 == 0 && s[step2].y2 == 0)) printf("%c", air); else - printf("%d", step2 % 10); //debug模式 + printf("%d", step2 % 10); //debug妯″紡 step2++; if (step2 >= max2) { @@ -1375,7 +1375,7 @@ void autochange() // cnt = 0; color = (color + 1) % 5; } - Sleep(150 - 2 * old_x2); //模拟下坠的时候速度加快--对应画面更新更快 + Sleep(150 - 2 * old_x2); //妯℃嫙涓嬪潬鐨勬椂鍊欓熷害鍔犲揩--瀵瑰簲鐢婚潰鏇存柊鏇村揩 if (map[old_x2][old_y2] == wall) { Vx = -Vx; @@ -1391,10 +1391,10 @@ void autochange() // end_brick(); } } -//-----------------------------------------------------------------------------打砖块/----------------------------------------------------------------------------- +//-----------------------------------------------------------------------------鎵撶爾鍧/----------------------------------------------------------------------------- void put_letter_to_computer(char letter) -{ //把字符传输给电脑屏幕,如果电脑if_input为零就禁止显示 +{ //鎶婂瓧绗︿紶杈撶粰鐢佃剳灞忓箷锛屽鏋滅數鑴慽f_input涓洪浂灏辩姝㈡樉绀 int i; if (if_input == 1 && put_in_num < input_max) { @@ -1417,11 +1417,11 @@ void put_letter_to_computer(char letter) printf("%s", put_in_computer); } void put_function_to_computer(int function) -{ //电脑处理相应共呢 1 ~ 返回 2 ~删除 3确认 4shift 5上 6左 7下 8又 9开机 +{ //鐢佃剳澶勭悊鐩稿簲鍏卞憿 1 ~ 杩斿洖 2 ~鍒犻櫎 3纭 4shift 5涓 6宸 7涓 8鍙 9寮鏈 int ncx, ncy; char ch; if (function == 9) - { //开机 + { //寮鏈 system("color 70"); if (if_start == 0) { @@ -1440,7 +1440,7 @@ void put_function_to_computer(int function) } } if (function == 2 && put_in_num > 0 && if_input == 1) - { //删除字符,但不可越界 + { //鍒犻櫎瀛楃锛屼絾涓嶅彲瓒婄晫 put_in_num--; put_in_computer[put_in_num] = '\0'; if (if_input_password == 1) @@ -1456,14 +1456,14 @@ void put_function_to_computer(int function) } } if (function == 4) - { //切换大小写 + { //鍒囨崲澶у皬鍐 if (if_shift) if_shift = 0; else if_shift = 1; } if (function == 3 && if_input == 1 && if_game == 0) - { //确认对应不同模式下的不同功能 + { //纭瀵瑰簲涓嶅悓妯″紡涓嬬殑涓嶅悓鍔熻兘 if (strcmp(password_0, put_in_computer) == 0) { if_input_password = 0; @@ -1477,7 +1477,7 @@ void put_function_to_computer(int function) put_in_num = 0; put_in_computer[put_in_num] = '\0'; gotoxy(input_y, input_x); - printf("密 码 错 误 !!!"); + printf("瀵 鐮 閿 璇 锛侊紒锛"); gotoxy(input_y, input_x); Sleep(1200); printf(" "); @@ -1510,10 +1510,10 @@ void put_function_to_computer(int function) put_in_num = 0; put_in_computer[0] = '\0'; } - //if(if_game == 1 && function >= 5 && function <= 8)) 移动类型游戏暂未开放 (3.19更新可用了) + //if(if_game == 1 && function >= 5 && function <= 8)) 绉诲姩绫诲瀷娓告垙鏆傛湭寮鏀 (3.19鏇存柊鍙敤浜) else if (if_game == 2 && function >= 5 && function <= 8) { - //5上 6左 7下 8又 + //5涓 6宸 7涓 8鍙 ch = 'a'; switch (function) { @@ -1535,12 +1535,12 @@ void put_function_to_computer(int function) } else if (function == 3 && if_into_desktop) { - if (computer_map[cx][cy] == 1) //1 - 汉诺塔 2 - 打砖块 + if (computer_map[cx][cy] == 1) //1 - 姹夎濉 2 - 鎵撶爾鍧 { load_game(); if_game = 1; } - else if (computer_map[cx][cy] == 2) //打砖块 + else if (computer_map[cx][cy] == 2) //鎵撶爾鍧 { if_into_desktop = 0; init_brick(); @@ -1548,10 +1548,10 @@ void put_function_to_computer(int function) system("color 07"); } else if (computer_map[cx][cy] == 3) - { //(我的电脑) + { //锛堟垜鐨勭數鑴戯級 my_computer(); } - else if (computer_map[cx][cy] == 4) // 更多信息 + else if (computer_map[cx][cy] == 4) // 鏇村淇℃伅 { load_more(); getch(); @@ -1560,7 +1560,7 @@ void put_function_to_computer(int function) load_desktop(); } else if (computer_map[cx][cy] == 5) - { //浏览器(因为不支持,所以使用就蓝屏(滑稽)) + { //娴忚鍣紙鍥犱负涓嶆敮鎸侊紝鎵浠ヤ娇鐢ㄥ氨钃濆睆锛堟粦绋斤級锛 blue_screen(); } } @@ -1580,37 +1580,37 @@ void put_function_to_computer(int function) } } if (function == 1 && if_into_desktop) - { //返回 + { //杩斿洖 load_desktop(); } } int main() { - if_my_map = 0; //是否加载自己设置的关卡,改成1后 my_map数组就是内置地图 + if_my_map = 0; //鏄惁鍔犺浇鑷繁璁剧疆鐨勫叧鍗★紝鏀规垚1鍚 my_map鏁扮粍灏辨槸鍐呯疆鍦板浘 HideCursor(); init(); - /*load_desktop(); //直接进入桌面 + /*load_desktop(); //鐩存帴杩涘叆妗岄潰 if_start = 1; if_into_desktop = 1;*/ HideCursor(); while (1) - { //主循环w - if (if_game == 2) //打砖块 + { //涓诲惊鐜痺 + if (if_game == 2) //鎵撶爾鍧 autochange(); if (kbhit()) { - flag = move(); //move提取读取的键盘按键并判断类型 + flag = move(); //move鎻愬彇璇诲彇鐨勯敭鐩樻寜閿苟鍒ゆ柇绫诲瀷 switch (flag) { case 0: - break; //暂无效果的按键 + break; //鏆傛棤鏁堟灉鐨勬寜閿 case 1: put_letter_to_computer(letter); - break; //返回字符型按键给电脑 + break; //杩斿洖瀛楃鍨嬫寜閿粰鐢佃剳 case 2: put_function_to_computer(function); - break; //返回功能型按键给电脑 + break; //杩斿洖鍔熻兘鍨嬫寜閿粰鐢佃剳 } } } diff --git "a/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254\357\274\210\346\213\223\345\261\225\345\256\214\345\226\204\347\211\210\357\274\211/win10\344\273\245\344\270\213_ver_3.0\357\274\210\346\227\247\346\216\247\345\210\266\345\217\260\357\274\211/\350\207\252\350\241\214\347\274\226\350\257\221.txt" "b/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254\357\274\210\346\213\223\345\261\225\345\256\214\345\226\204\347\211\210\357\274\211/win10\344\273\245\344\270\213_ver_3.0\357\274\210\346\227\247\346\216\247\345\210\266\345\217\260\357\274\211/\350\207\252\350\241\214\347\274\226\350\257\221.txt" index baf4a29..eebefd3 100644 --- "a/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254\357\274\210\346\213\223\345\261\225\345\256\214\345\226\204\347\211\210\357\274\211/win10\344\273\245\344\270\213_ver_3.0\357\274\210\346\227\247\346\216\247\345\210\266\345\217\260\357\274\211/\350\207\252\350\241\214\347\274\226\350\257\221.txt" +++ "b/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254\357\274\210\346\213\223\345\261\225\345\256\214\345\226\204\347\211\210\357\274\211/win10\344\273\245\344\270\213_ver_3.0\357\274\210\346\227\247\346\216\247\345\210\266\345\217\260\357\274\211/\350\207\252\350\241\214\347\274\226\350\257\221.txt" @@ -1,57 +1,57 @@ /*--------------------------------------------------------- -程序: 模拟笔记本电脑 (纯C语言,可直接编译器运行) -作者: 404name -说明: 1.这个程序本意在模拟电脑的基本功能,重在实现键盘的输入与键盘的控制,模拟开机,输密,打开软件,关闭电脑,所以其他功能暂没开发,不用太失望。 - 2.不同的编码会有不同的长度显示,但运行出来的效果都是一样的 - 3.代码规范不到位,见谅。 - 4.大一上写的,一般写小游戏练手,也琢磨到一些特殊的处理方法,所以对一些功能处理上有一些难理解的地方。 - 5.emmm,没啥了 - 6.感觉大一下太难了。qwq,在家学习效率太低。尽力学点新东西把。 -程序进度: 于2.10号停止更新(目前不再会加入新功能了,模板搭建完了,功能已经全部写完,再加入一些东西也没太大意义,还是去学学java去了) -程序结构: 程序因为加入了打砖块,部分函数顺序需要调换,影响体验。此处给出按顺序的走法。 - 这里其实总体上是有顺序的,但代码太多看起来就很乱。 - 解决方案:先定义函数再在主函数后面分类写。并没有采用,因为习惯性写前面,嘿嘿。。 +绋嬪簭锛 妯℃嫙绗旇鏈數鑴 锛堢函C璇█锛屽彲鐩存帴缂栬瘧鍣ㄨ繍琛岋級 +浣滆咃細 404name +璇存槑锛 1.杩欎釜绋嬪簭鏈剰鍦ㄦā鎷熺數鑴戠殑鍩烘湰鍔熻兘锛岄噸鍦ㄥ疄鐜伴敭鐩樼殑杈撳叆涓庨敭鐩樼殑鎺у埗锛屾ā鎷熷紑鏈猴紝杈撳瘑锛屾墦寮杞欢锛屽叧闂數鑴戯紝鎵浠ュ叾浠栧姛鑳芥殏娌″紑鍙戯紝涓嶇敤澶け鏈涖 + 2.涓嶅悓鐨勭紪鐮佷細鏈変笉鍚岀殑闀垮害鏄剧ず锛屼絾杩愯鍑烘潵鐨勬晥鏋滈兘鏄竴鏍风殑 + 3.浠g爜瑙勮寖涓嶅埌浣嶏紝瑙佽皡銆 + 4.澶т竴涓婂啓鐨勶紝涓鑸啓灏忔父鎴忕粌鎵嬶紝涔熺悽纾ㄥ埌涓浜涚壒娈婄殑澶勭悊鏂规硶锛屾墍浠ュ涓浜涘姛鑳藉鐞嗕笂鏈変竴浜涢毦鐞嗚В鐨勫湴鏂广 + 5.emmm锛屾病鍟ヤ簡 + 6.鎰熻澶т竴涓嬪お闅句簡銆俼wq锛屽湪瀹跺涔犳晥鐜囧お浣庛傚敖鍔涘鐐规柊涓滆タ鎶娿 +绋嬪簭杩涘害锛 浜2.10鍙峰仠姝㈡洿鏂帮紙鐩墠涓嶅啀浼氬姞鍏ユ柊鍔熻兘浜嗭紝妯℃澘鎼缓瀹屼簡锛屽姛鑳藉凡缁忓叏閮ㄥ啓瀹岋紝鍐嶅姞鍏ヤ竴浜涗笢瑗夸篃娌″お澶ф剰涔夛紝杩樻槸鍘诲瀛ava鍘讳簡锛 +绋嬪簭缁撴瀯锛 绋嬪簭鍥犱负鍔犲叆浜嗘墦鐮栧潡锛岄儴鍒嗗嚱鏁伴『搴忛渶瑕佽皟鎹紝褰卞搷浣撻獙銆傛澶勭粰鍑烘寜椤哄簭鐨勮蛋娉曘 + 杩欓噷鍏跺疄鎬讳綋涓婃槸鏈夐『搴忕殑锛屼絾浠g爜澶鐪嬭捣鏉ュ氨寰堜贡銆 + 瑙e喅鏂规锛氬厛瀹氫箟鍑芥暟鍐嶅湪涓诲嚱鏁板悗闈㈠垎绫诲啓銆傚苟娌℃湁閲囩敤锛屽洜涓轰範鎯у啓鍓嶉潰锛屽樋鍢裤傘 - |变量区:(数组+变量) - |子函数区: - ·系统自带函数:光标隐藏+gotoxy - ·汉诺塔执行相关函数 - ·主程序init函数 - ·主程序界面加载函数: - ·开机画面 - ·关机画面 - ·蓝屏画面 - ·更多信息画面 - ·电脑系统配置画面 - ·打砖块执行相关函数 - ·主程序功能函数: - ·处理返回的字符型按键函数 - ·处理返回的功能型按键函数 - |主函数: - ·主循环 -修复历史: - (2020) - 3.10修复字符显示乱码 - 3.15修复关机仍能输入密码 - 3.15加入光标隐藏(关闭前往init函数第一行) - 3.19加入可移动游戏简洁版,可前往main函数自己开关 - 4.07丰富细节,更加贴近xp系统。 - ·密码输入优化,输入的密码会在下一次输入变成不可视。 - ·优化打砖块对角碰撞算法,更加真实。 - ·新增“此电脑”可查看电脑配置. - ·新增关机画面。 - ·优化细节. -指路区: 1.自制地图插入 前往my_map[][]数组 大概300多行处修改; - 2.打砖块抛物线算法解析 前往autochange()函数 1000多行处 + |鍙橀噺鍖猴細锛堟暟缁+鍙橀噺锛 + |瀛愬嚱鏁板尯锛 + 路绯荤粺鑷甫鍑芥暟锛氬厜鏍囬殣钘+gotoxy + 路姹夎濉旀墽琛岀浉鍏冲嚱鏁 + 路涓荤▼搴廼nit鍑芥暟 + 路涓荤▼搴忕晫闈㈠姞杞藉嚱鏁帮細 + 路寮鏈虹敾闈 + 路鍏虫満鐢婚潰 + 路钃濆睆鐢婚潰 + 路鏇村淇℃伅鐢婚潰 + 路鐢佃剳绯荤粺閰嶇疆鐢婚潰 + 路鎵撶爾鍧楁墽琛岀浉鍏冲嚱鏁 + 路涓荤▼搴忓姛鑳藉嚱鏁帮細 + 路澶勭悊杩斿洖鐨勫瓧绗﹀瀷鎸夐敭鍑芥暟 + 路澶勭悊杩斿洖鐨勫姛鑳藉瀷鎸夐敭鍑芥暟 + |涓诲嚱鏁帮細 + 路涓诲惊鐜 +淇鍘嗗彶锛 + 锛2020锛 + 3.10淇瀛楃鏄剧ず涔辩爜 + 3.15淇鍏虫満浠嶈兘杈撳叆瀵嗙爜 + 3.15鍔犲叆鍏夋爣闅愯棌锛堝叧闂墠寰init鍑芥暟绗竴琛岋級 + 3.19鍔犲叆鍙Щ鍔ㄦ父鎴忕畝娲佺増锛屽彲鍓嶅線main鍑芥暟鑷繁寮鍏 + 4.07涓板瘜缁嗚妭锛屾洿鍔犺创杩憍p绯荤粺銆 + 路瀵嗙爜杈撳叆浼樺寲锛岃緭鍏ョ殑瀵嗙爜浼氬湪涓嬩竴娆¤緭鍏ュ彉鎴愪笉鍙銆 + 路浼樺寲鎵撶爾鍧楀瑙掔鎾炵畻娉曪紝鏇村姞鐪熷疄銆 + 路鏂板鈥滄鐢佃剳鈥濆彲鏌ョ湅鐢佃剳閰嶇疆. + 路鏂板鍏虫満鐢婚潰銆 + 路浼樺寲缁嗚妭. +鎸囪矾鍖猴細 1.鑷埗鍦板浘鎻掑叆 鍓嶅線my_map[][]鏁扮粍 澶ф300澶氳澶勪慨鏀癸紱 + 2.鎵撶爾鍧楁姏鐗╃嚎绠楁硶瑙f瀽 鍓嶅線autochange()鍑芥暟 1000澶氳澶 ---------------------------------------------------------*/ -#include //用于getch() +#include //鐢ㄤ簬getch锛堬級 #include #include #include #include #define pi 3.14 -const double g = 10; //标准数越模糊,轨迹越连贯。 -char start[20][500] = { //图形界面 +const double g = 10; //鏍囧噯鏁拌秺妯$硦锛岃建杩硅秺杩炶疮銆 +char start[20][500] = { //鍥惧舰鐣岄潰 {"+--------------------------------------------------------------------------------------------------------------------------+"}, {" \\ /"}, {" \\ /"}, @@ -67,7 +67,7 @@ char start[20][500] = { //图 {" \\ | | /"}, {" \\ +--------------------+ /"}, {" \\ /"}, - {" \\ Copyright Θ Microsoft Corporation Microsoft /"}, + {" \\ Copyright 螛 Microsoft Corporation Microsoft /"}, {" \\ __________________________________________________________________________________________/"}}; char password[20][500] = { {"+--------------------------------------------------------------------------------------------------------------------------+"}, @@ -78,11 +78,11 @@ char password[20][500] = { {" \\ | /"}, {" \\ | +--------------------------------------------- /"}, {" \\ /~/~/ | |+-----+ Administrator /"}, - {" \\ /~/~/ __XP | || [] | 输入密码 /"}, - {" \\ \\ /\\ / - _ _| _ ~ ~ /_ | |+-----+ 【| 】ck[→] /"}, + {" \\ /~/~/ __XP | || [] | 杈撳叆瀵嗙爜 /"}, + {" \\ \\ /\\ / - _ _| _ ~ ~ /_ | |+-----+ 銆恷 銆慶k[鈫抅 /"}, {" \\ \\/ \\/ | | | |_| |_| \\/\\/ __/ | +--------------------------------------- /"}, {" \\ | /"}, - {" \\ 要开始,请单击您的用户名 | /"}, + {" \\ 瑕佸紑濮嬶紝璇峰崟鍑绘偍鐨勭敤鎴峰悕 | /"}, {" \\ | /"}, {" \\ /"}, {" \\ ---------------------------------------------------------------------------------------- /"}, @@ -92,18 +92,18 @@ char desktop[20][500] = { {" \\ ----- ----- ----- +----+ +----+ /"}, {" \\ \\ \\ \\ \\ \\ \\ | | |ing | /"}, {" \\ ----- ----- ----- +----+ +----+ /"}, - {" \\ 汉诺塔 打砖块 我的电脑 相关 待开发 /"}, + {" \\ 姹夎濉 鎵撶爾鍧 鎴戠殑鐢佃剳 鐩稿叧 寰呭紑鍙 /"}, {" \\ ----- /"}, {" \\ \\ \\ /"}, {" \\ ----- __ --------------- __ __ /"}, - {" \\ IE浏览器__-- --- __ -------_ -------_------____ /"}, + {" \\ IE娴忚鍣╛_-- --- __ -------_ -------_------____ /"}, {" \\ ____ __--__ -- __ -------_ --- - __ --- __ --------------______ /"}, {" \\__ -------_--__ ------- __ ---------- __ ------ __ ------ __ --- __ ---------____ /"}, {" \\ -------_---__ ------- _---- __ -------_ ---_ -------_ -_ ----------_ -_---_ -_ ------_ -_ /"}, {" \\--__ -- __ ----- __ ------ __ -------_ --- ---- __ -------_ -_ ---------_ -_ ------_ -_ ------ /"}, {" \\ -_--__ ------- _---- __ -------_ ------- __ -------_ -- __ -------_ -_ --------__---_ -_ ------/"}, {" \\ _____________________________________________________________________________________________ /"}, - {" \\ 开始 \\ qq2010 | | 12:00 /"}, + {" \\ 寮濮 \\ qq2010 | | 12:00 /"}, {" \\ __________________________________________________________________________________________/"}}; char game_hnt[20][500] = { {"+--------------------------------------------------------------------------------------------------------------------------+"}, @@ -121,43 +121,43 @@ char game_hnt[20][500] = { {" \\ /"}, {" \\ +-------------------------------------------------------------------------------------------+ /"}, {" \\ _____________________________________________________________________________________________ /"}, - {" \\ 开始 \\ qq2010 | 汉诺塔自动演示小游戏 | | 12:08 /"}, + {" \\ 寮濮 \\ qq2010 | 姹夎濉旇嚜鍔ㄦ紨绀哄皬娓告垙 | | 12:08 /"}, {" \\ __________________________________________________________________________________________/"}}; char MyComputer[20][500] = { {"+--------------------------------------------------------------------------------------------------------------------------+"}, {" \\ +----------------------------------------------------------------------------------------------------------------+ /"}, - {" \\ \\系统属性| |?| X / /"}, - {" \\ \\= 常规 =|计算机名|硬件|高级|自动更新|远程| / /"}, - {" \\ \\ 系统: / /"}, + {" \\ \\绯荤粺灞炴 |锛焲 X / /"}, + {" \\ \\= 甯歌 =|璁$畻鏈哄悕|纭欢|楂樼骇|鑷姩鏇存柊|杩滅▼| / /"}, + {" \\ \\ 绯荤粺锛 / /"}, {" \\ \\ +------------+ Microsoft Windows XP/ /"}, {" \\ \\ | /~/~/ | Professional / /"}, - {" \\ \\ | /~/~/ | 版本 2.3.3.3 / /"}, + {" \\ \\ | /~/~/ | 鐗堟湰 2.3.3.3 / /"}, {" \\ \\ +------------+ / /"}, - {" \\ \\ ---- 绝伦 && 404name / /"}, - {" \\ \\ 制造商和技术支持商 : Pentium(R) Core CPU / /"}, - {" \\ \\ M i c r o s o f t 2.52GHz, 1.99GB内存 / /"}, - {" \\ \\ 技术支持信息(S) / /"}, + {" \\ \\ ---- 缁濅鸡 && 404name / /"}, + {" \\ \\ 鍒堕犲晢鍜屾妧鏈敮鎸佸晢 : Pentium(R) Core CPU / /"}, + {" \\ \\ M i c r o s o f t 2.52GHz, 1.99GB鍐呭瓨 / /"}, + {" \\ \\ 鎶鏈敮鎸佷俊鎭(S) / /"}, {" \\ +-------------------------------------------------------------------------------------------+ /"}, {" \\ _____________________________________________________________________________________________ /"}, - {" \\ 开始 \\ qq2010 | 系统属性 | | 12:08 /"}, + {" \\ 寮濮 \\ qq2010 | 绯荤粺灞炴 | | 12:08 /"}, {" \\ __________________________________________________________________________________________/"}}; char thinking[30][500] = { {"+--------------------------------------------------------------------------------------------------------------------------+"}, {" \\ +----------------------------------------------------------------------------------------------------------------+ /"}, - {" \\ 这里是相关:(最后更新2020.2.11) /"}, + {" \\ 杩欓噷鏄浉鍏筹細锛堟渶鍚庢洿鏂2020.2.11锛 /"}, {" \\ /"}, - {" \\ 寒假太颓废了,没劲学习,游戏玩腻,然后开始发呆。安静下来时才有灵感 ,看着笔记本,就想着我也编一个电脑系统吧 /"}, + {" \\ 瀵掑亣澶搴熶簡锛屾病鍔插涔狅紝娓告垙鐜╄吇锛岀劧鍚庡紑濮嬪彂鍛嗐傚畨闈欎笅鏉ユ椂鎵嶆湁鐏垫劅 锛岀湅鐫绗旇鏈紝灏辨兂鐫鎴戜篃缂栦竴涓數鑴戠郴缁熷惂 /"}, {" \\ /"}, - {" \\ 就想把大一上学到的一些东西总着来练练手。。然后发现写电脑系统就是痴人说梦了,我还是写个模拟计算机吧。 /"}, + {" \\ 灏辨兂鎶婂ぇ涓涓婂鍒扮殑涓浜涗笢瑗挎荤潃鏉ョ粌缁冩墜銆傘傜劧鍚庡彂鐜板啓鐢佃剳绯荤粺灏辨槸鐥翠汉璇存ⅵ浜嗭紝鎴戣繕鏄啓涓ā鎷熻绠楁満鍚с /"}, {" \\ /"}, - {" \\ 对着自己笔记本的键盘一个一个的还原,然后思考如何体现屏幕,如何移动键盘,如何读取键盘把信息传给我的 /"}, + {" \\ 瀵圭潃鑷繁绗旇鏈殑閿洏涓涓竴涓殑杩樺師锛岀劧鍚庢濊冨浣曚綋鐜板睆骞曪紝濡備綍绉诲姩閿洏锛屽浣曡鍙栭敭鐩樻妸淇℃伅浼犵粰鎴戠殑 /"}, {" \\ /"}, - {" \\ 虚拟电脑,如何模拟开机实现基本功能 ,一口气写完真心爽,最后想做互动游戏的,但这斜着的屏幕,emmm /"}, + {" \\ 铏氭嫙鐢佃剳锛屽浣曟ā鎷熷紑鏈哄疄鐜板熀鏈姛鑳 锛屼竴鍙f皵鍐欏畬鐪熷績鐖斤紝鏈鍚庢兂鍋氫簰鍔ㄦ父鎴忕殑锛屼絾杩欐枩鐫鐨勫睆骞曪紝emmm /"}, {" \\ /"}, - {" \\ 所以最后电脑只能运行汉诺塔,其他功能实现也简单,但还是把时间放在我突然又燃起的学习小火苗上吧/"}, + {" \\ 鎵浠ユ渶鍚庣數鑴戝彧鑳借繍琛屾眽璇哄锛屽叾浠栧姛鑳藉疄鐜颁篃绠鍗曪紝浣嗚繕鏄妸鏃堕棿鏀惧湪鎴戠獊鐒跺張鐕冭捣鐨勫涔犲皬鐏嫍涓婂惂/"}, {" \\ +-------------------------------------------------------------------------------------------+ /"}, {" \\ _____________________________________________________________________________________________ /"}, - {" \\ 开始 \\ qq2010 | 感想.txt | | 12:15 /"}, + {" \\ 寮濮 \\ qq2010 | 鎰熸兂.txt | | 12:15 /"}, {" \\ __________________________________________________________________________________________/"}}; char ending[30][500] = { {"+--------------------------------------------------------------------------------------------------------------------------+"}, @@ -174,7 +174,7 @@ char ending[30][500] = { {" \\ Once installed, your old computer might be able to run Internet explorer. That's cool. /"}, {" \\ /"}, {" \\ Technical information: /"}, - {" \\ ****** STOP 0x0000008E (0xc0000005,0xBF856CA8,0xB0F07A40,0x00000000) /"}, + {" \\ ****** STOP 0x0000008E 锛0xc0000005锛0xBF856CA8锛0xB0F07A40锛0x00000000锛 /"}, {" \\ ****** win32k.sys - Address BF853CA8 base at BF800000, DateStamp 5900ef5f /"}, {" \\ __________________________________________________________________________________________/"}}; char map[1000][1000] = { @@ -202,15 +202,15 @@ char map[1000][1000] = { {" || Esc | | F1| F2| F3| F4|| F5| F6| F7| F8|| F9|F10|F11|F12||Prt|Scr|Pau| ++ ++ ++ ++ |"}, {" |+-----+ +---+---+---+---++---+---+---+---++---+---+---+---++---+---+---+ ++ ++ ++ ++ |"}, {" |+----+---+---+---+---+---+---+---+---+---+---+---+---+-----++---+---+---++---+---+---+---+|"}, - {" || `~ | 1!| 2@| 3#| 4$| 5%| 6^| 7&| 8*| 9(| 0)| --| =+| ←--||Ins|Hom|Pgu||Num| / | * | - ||"}, + {" || `~ | 1!| 2@| 3#| 4$| 5%| 6^| 7&| 8*| 9(| 0)| --| =+| 鈫--||Ins|Hom|Pgu||Num| / | * | - ||"}, {" |+----++--++--++--++--++--++--++--++--++--++--++--++--++----++---+---+---++---+---+---+---+|"}, {" || Tab | Q | W | E | R | T | Y | U | I | O | P | [{| ]}| \\| ||Del|End|Pgd|| 7 | 8 | 9 | ||"}, {" |+-----++--++--++--++--++--++--++--++--++--++--++--++--+----++---+---+---++---+---+---+ + ||"}, {" || Caps | A | S | D | F | G | H | J | K | L | ;:| \'\"| Enter | | 4 | 5 | 6 | ||"}, {" |+------++--++--++--++--++--++--++--++--++--++--++--+-------+ +---+ +---+---+---+---+|"}, - {" || Shift | Z | X | C | V | B | N | M | ,<| .>| /?| Shift | | ↑| | 1 | 2 | 3 | |||"}, - {" |+----+--+-+-+--++---+---+---+---+---+---+--++---╪---+------++---+---+---++---+---+---+ |||"}, - {" || Ctr| win| Alt| ---- | Alt| Fn| Ctrl ||← | ↓| →|| 0ins |.de|←+||"}, + {" || Shift | Z | X | C | V | B | N | M | ,<| .>| /?| Shift | | 鈫憒 | 1 | 2 | 3 | |||"}, + {" |+----+--+-+-+--++---+---+---+---+---+---+--++---鈺---+------++---+---+---++---+---+---+ |||"}, + {" || Ctr| win| Alt| ---- | Alt| Fn| Ctrl ||鈫 | 鈫搢 鈫抾| 0ins |.de|鈫+||"}, {" |+----+----+----+---------------------------+----+---+------++---+---+---++-------+---+---+|"}, {" | +-------------------------------+ |"}, {" | | | |"}, @@ -218,9 +218,9 @@ char map[1000][1000] = { {" | |---------------+---------------| |"}, {" | +---------------+---------------+ |"}, {" +------------------------------------------------------------------------------------------+"}}; -//功能数组 +//鍔熻兘鏁扮粍 int keyboard[20][30] = { - //把键盘看成一个地图让move函数在上面移动返回的数值对应下面的 board_place[120][5]是对应按键的全部信息 + //鎶婇敭鐩樼湅鎴愪竴涓湴鍥捐move鍑芥暟鍦ㄤ笂闈㈢Щ鍔ㄨ繑鍥炵殑鏁板煎搴斾笅闈㈢殑 board_place[120][5]鏄搴旀寜閿殑鍏ㄩ儴淇℃伅 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 104, 104, 104, 104}, {0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37}, @@ -229,14 +229,14 @@ int keyboard[20][30] = { {0, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 86, 86, 0, 87, 0, 88, 89, 90, 91}, {0, 92, 93, 94, 95, 95, 95, 95, 95, 95, 95, 96, 97, 98, 98, 99, 100, 101, 102, 102, 103, 91}, }; -int next[9][2] = {{0}, {0}, {0}, {0}, {0}, {-1, 0}, {0, -1}, {1, 0}, {0, 1}}; //给键盘传给虚拟键盘的键盘控制虚拟电脑用 -int computer_map[3][8] = {{0, 0, 0, 0, 0}, {0, 1, 2, 3, 4}, {0, 5, 0, 0, 0}}; //对应的移动操作记录 +int next[9][2] = {{0}, {0}, {0}, {0}, {0}, {-1, 0}, {0, -1}, {1, 0}, {0, 1}}; //缁欓敭鐩樹紶缁欒櫄鎷熼敭鐩樼殑閿洏鎺у埗铏氭嫙鐢佃剳鐢 +int computer_map[3][8] = {{0, 0, 0, 0, 0}, {0, 1, 2, 3, 4}, {0, 5, 0, 0, 0}}; //瀵瑰簲鐨勭Щ鍔ㄦ搷浣滆褰 int computer_map_place[6][2] = {{0}, {2, 9}, {2, 19}, {2, 29}, {2, 40}, {6, 12}}; int cx, cy, tcx, tcy, lcx, lcy; -int board_place[120][5] = { //这是按键的信息 下标依次对应 -返回值 -按下shift下的返回值2 -键盘字符长度 -字符坐标x -y - {0, 0, 0, 0, 0}, //第一项如果是字符那么那就是返回字符 如果是数字1-9那么就是功能按键功能对应如下 +int board_place[120][5] = { //杩欐槸鎸夐敭鐨勪俊鎭 涓嬫爣渚濇瀵瑰簲 -杩斿洖鍊 -鎸変笅shift涓嬬殑杩斿洖鍊2 -閿洏瀛楃闀垮害 -瀛楃鍧愭爣x -y + {0, 0, 0, 0, 0}, //绗竴椤瑰鏋滄槸瀛楃閭d箞閭e氨鏄繑鍥炲瓧绗 濡傛灉鏄暟瀛1-9閭d箞灏辨槸鍔熻兘鎸夐敭鍔熻兘瀵瑰簲濡備笅 {1, 1, 3, 21, 19}, //1-10 - {0, 0, 2, 21, 28}, //1 ~ 返回 2 ~删除 3确认 4shift 5上 6左 7下 8又 9开机 + {0, 0, 2, 21, 28}, //1 ~ 杩斿洖 2 ~鍒犻櫎 3纭 4shift 5涓 6宸 7涓 8鍙 9寮鏈 {0, 0, 2, 21, 32}, {0, 0, 2, 21, 36}, {0, 0, 2, 21, 40}, @@ -340,25 +340,25 @@ int board_place[120][5] = { // {'.', '.', 4, 32, 99}, {9, 9, 4, 18, 99}}; -// 程序功能变量 -int flag, function, if_shift, if_start, if_input_password, if_into_desktop, if_game, qpz; //0表示输入无效,1表示是输入电脑键 2表示是功能键 +// 绋嬪簭鍔熻兘鍙橀噺 +int flag, function, if_shift, if_start, if_input_password, if_into_desktop, if_game, qpz; //0琛ㄧず杈撳叆鏃犳晥锛1琛ㄧず鏄緭鍏ョ數鑴戦敭 2琛ㄧず鏄姛鑳介敭 char letter; int x, y, tx, ty, num, lx, ly; char temp[6] = {"====="}; char put_in_computer[20]; -char password_0[20] = {"WHJY"}; // 密码 +char password_0[20] = {"WHJY"}; // 瀵嗙爜 int put_in_num, if_input, input_x, input_y, input_max; -// 汉诺塔游戏变量 +// 姹夎濉旀父鎴忓彉閲 int mid_x, mid_y; int len, width, left, mid, right, time; int ttx, tty; char game_map[80][1000]; -int game_next[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; //上0下1左2右3; +int game_next[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; //涓0涓1宸2鍙3锛 -int turn[2][3] = {{0, 3, 1}, //a -> b b -> c a -> c 上右下 - {0, 2, 1}}; //b -> a c -> b c -> a 上左下 //实现自动移动的路线储存 +int turn[2][3] = {{0, 3, 1}, //a -> b b -> c a -> c 涓婂彸涓 + {0, 2, 1}}; //b -> a c -> b c -> a 涓婂乏涓 //瀹炵幇鑷姩绉诲姩鐨勮矾绾垮偍瀛 -//打砖块游戏变量 +//鎵撶爾鍧楁父鎴忓彉閲 char map2[1000][1000]; char End[20][50] = { {" ## ## ## "}, @@ -375,11 +375,11 @@ char End[20][50] = { {"###### ####### ### ## ### "}, {"### ####### ## ## ## "}, {" ## ## ## "}, - {" 按 任 意 键 继 续 "}, + {" 鎸 浠 鎰 閿 缁 缁 "}, }; //----------------------------------------------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------------------------------------------- -//此处是人工地图接口(开启请前往main函数里面设置下面0为1并且自己改变图案) +//姝ゅ鏄汉宸ュ湴鍥炬帴鍙o紙寮鍚鍓嶅線main鍑芥暟閲岄潰璁剧疆涓嬮潰0涓1骞朵笖鑷繁鏀瑰彉鍥炬锛 int if_my_map; char my_map[50][500] = {{"#############################################################################################################################"}, {"## life: | | | ##"}, @@ -398,36 +398,36 @@ char my_map[50][500] = {{"###################################################### {"############### ###############"}, {"################ ########### ################"}, {"#############################################################################################################################"}}; -//修改规则: -//显然电脑屏幕外是不能动的只能修改里面梯形 -// 墙~# 砖块~0 空气~' ' -//小球在倒数第七行 23~27列之间随机生成,不能占位 -//左下角是木板生成地,左上是生命 不可改(要改需调参数) +//淇敼瑙勫垯锛 +//鏄剧劧鐢佃剳灞忓箷澶栨槸涓嶈兘鍔ㄧ殑鍙兘淇敼閲岄潰姊舰 +// 澧檦# 鐮栧潡~0 绌烘皵~' ' +//灏忕悆鍦ㄥ掓暟绗竷琛 23~27鍒椾箣闂撮殢鏈虹敓鎴愶紝涓嶈兘鍗犱綅 +//宸︿笅瑙掓槸鏈ㄦ澘鐢熸垚鍦帮紝宸︿笂鏄敓鍛 涓嶅彲鏀癸紙瑕佹敼闇璋冨弬鏁帮級 //----------------------------------------------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------------------------------------------- -//全局变量区,在init里面改变 +//鍏ㄥ眬鍙橀噺鍖猴紝鍦╥nit閲岄潰鏀瑰彉 char wall, food, air, brick; int width2, length2; -double X2, Y2, x2, y2, Vx, Vy, t2, V; //默认向下向右为正 +double X2, Y2, x2, y2, Vx, Vy, t2, V; //榛樿鍚戜笅鍚戝彸涓烘 int old_x2, old_y2, head2, tail2, max2, step2, if_miss, food_num, goal, color, add_x, add_y, cnt; -int if_load_snake_mod, debug, life; //debug模式调成1手动开启 -int temp_x2, temp_y2, menu_x, menu_y, left2, right2; //临时坐标 -double C[8] = {0, 10, 30, 55, 90}; //初始斜抛的角度,自右向上转角(目前已调整好最好的角度) +int if_load_snake_mod, debug, life; //debug妯″紡璋冩垚1鎵嬪姩寮鍚 +int temp_x2, temp_y2, menu_x, menu_y, left2, right2; //涓存椂鍧愭爣 +double C[8] = {0, 10, 30, 55, 90}; //鍒濆鏂滄姏鐨勮搴︼紝鑷彸鍚戜笂杞(鐩墠宸茶皟鏁村ソ鏈濂界殑瑙掑害) -struct Step //轨迹 +struct Step //杞ㄨ抗 { int x2; int y2; } s[1000]; -void HideCursor() //光标隐藏 +void HideCursor() //鍏夋爣闅愯棌 { - CONSOLE_CURSOR_INFO cursor_info = {1, 0}; //后边的0代表光标不可见 + CONSOLE_CURSOR_INFO cursor_info = {1, 0}; //鍚庤竟鐨0浠h〃鍏夋爣涓嶅彲瑙 SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info); } -void gotoxy(int x, int y) //坐标函数 +void gotoxy(int x, int y) //鍧愭爣鍑芥暟 { HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); COORD pos; @@ -436,7 +436,7 @@ void gotoxy(int x, int y) // SetConsoleCursorPosition(handle, pos); } void init_game(int n) -{ //初始化汉诺塔 +{ //鍒濆鍖栨眽璇哄 int i, j; mid_x = 7, mid_y = 60; ttx = 10, tty = 10; @@ -458,12 +458,12 @@ void init_game(int n) if (num && (i >= 1 && i <= width - 1) && j % 2 != 0 && j < mid) { game_map[i][j] = -95; - game_map[i][j + 1] = -10; //打印 ■ ■占2个字节可以拆开来 + game_map[i][j + 1] = -10; //鎵撳嵃 鈻 鈻犲崰2涓瓧鑺傚彲浠ユ媶寮鏉 num--; } } } - //容易出现东西卡顿 + //瀹规槗鍑虹幇涓滆タ鍗¢】 for (i = 0; i <= width; i++) { gotoxy(tty, ttx + i); @@ -474,14 +474,14 @@ void init_game(int n) } void play(int x, int y) -{ //显示汉诺塔移动轨迹 +{ //鏄剧ず姹夎濉旂Щ鍔ㄨ建杩 int turn_0, n = 0, i, j, k, tx, ty, flag = 0; if ((x == mid && y == right) || (x == left && y == mid) || (x == left && y == right)) - turn_0 = 0; //往右 + turn_0 = 0; //寰鍙 else if ((x == mid && y == left) || (x == right && y == left) || (x == right && y == mid)) - turn_0 = 1; //往左 + turn_0 = 1; //寰宸 for (i = 1, j = y; i <= width; i++) - { //目的地 + { //鐩殑鍦 if (game_map[i][j] != 0) { tx = i - 1; @@ -490,7 +490,7 @@ void play(int x, int y) } } for (i = 1, j = x; i <= width; i++) - { //出发点 + { //鍑哄彂鐐 if (game_map[i][j] != 0) { break; @@ -527,7 +527,7 @@ void play(int x, int y) printf("%c", game_map[i][j + k]); } } - n++; //改变方向; + n++; //鏀瑰彉鏂瑰悜; if (i == tx && j == ty) return; if (turn_0 == 0) @@ -558,7 +558,7 @@ void play(int x, int y) } void move_hnt(int a, int b, int c, char aa, char bb, char cc, int n) -{ //正常的汉诺塔递归程序 +{ //姝e父鐨勬眽璇哄閫掑綊绋嬪簭 if (n == 1) { //printf("from %c to %c",aa,cc); @@ -573,9 +573,9 @@ void move_hnt(int a, int b, int c, char aa, char bb, char cc, int n) } void init() { - int i, j, k; //初始化整个程序 + int i, j, k; //鍒濆鍖栨暣涓▼搴 char ch; - HideCursor(); //决定是否开启光标隐藏 + HideCursor(); //鍐冲畾鏄惁寮鍚厜鏍囬殣钘 cx = 1, cy = 1; lcx = cx, lcy = cy; mid_x = 7, mid_y = 60; @@ -583,34 +583,34 @@ void init() flag = 0, function, if_shift = 0, if_start = 0, if_input_password = 0, if_into_desktop = 0, if_game = 0; put_in_num = 0, if_input = 0; system("mode con cols=125 lines=60"); - printf("【程序信息】:\n"); - printf(" 程序名称:模拟笔记本电脑\n"); - printf(" 程序作者:404name\n"); - printf(" 完成时间:2020.2.01\n"); - printf(" 最后更新:2020.4.07\n"); - printf(" 项目地址:https://github.com/404name/winter (有问题可以去联系我)\n\n"); - printf("【更新记录】(2020)\n"); - printf(" 3.10 修复bug:不同平台显示乱码\n"); - printf(" 3.15 修复bug:关机仍能输入密码\n"); - printf(" 3.15 优化体验:加入光标隐藏(关闭前往init函数第一行)\n"); - printf(" 3.19 完善功能:加入可移动游戏简洁版,可自制地图,方法前往源程序my_map数组处查看\n"); - printf(" 4.07 完善功能:(桌面软件全部更新,功能完善,更加贴近xp系统。)\n"); - printf(" ·密码输入优化,输入的密码会在下一次输入变成不可视。\n"); - printf(" ·优化打砖块对角碰撞算法,更加真实。\n"); - printf(" ·新增“此电脑”可查看电脑配置.\n"); - printf(" ·新增关机画面。\n"); - printf(" ·加入蓝屏,更加快乐(点击浏览器触发)\n"); - printf(" ·优化更多细节.\n\n"); - printf("【程序补充】\n"); - printf(" ·这里差不多把坑填完了,之前反应的要有能操控的游戏,输入密码可见不真实,关机画面没模拟等等\n"); - printf(" ·都弄完了,至于网上冲浪,打lol,写编译器就有生之年吧。对了,因此我还特意加入了蓝屏(滑稽)。\n\n"); - printf("【程序说明】\n"); - printf(" ·有问题,有bug,不兼容,欢迎去git反馈交流\n"); - printf(" ·操作方法:↑ ↓ ← → 空格 控制光标即可。\n"); - printf(" ·进入程序电源键处按一次空格||输入密码WHJY即可登录||请在虚拟键盘上开启大写再输入||\n"); - printf(" ·欢迎使用XP模拟笔记本电脑!\n"); - printf(" 1.按两下回车进入(未能解决bug移动时周围可能会有蓝色的闪频)\n"); - printf(" 2.按1再按回车进入 (开启清除闪频,光标背景由蓝色变成底色)\n"); + printf("銆愮▼搴忎俊鎭戯細\n"); + printf(" 绋嬪簭鍚嶇О锛氭ā鎷熺瑪璁版湰鐢佃剳\n"); + printf(" 绋嬪簭浣滆咃細404name\n"); + printf(" 瀹屾垚鏃堕棿锛2020.2.01\n"); + printf(" 鏈鍚庢洿鏂帮細2020.4.07\n"); + printf(" 椤圭洰鍦板潃锛歨ttps://github.com/404name/winter 锛堟湁闂鍙互鍘昏仈绯绘垜锛塡n\n"); + printf("銆愭洿鏂拌褰曘戯紙2020锛塡n"); + printf(" 3.10 淇bug锛氫笉鍚屽钩鍙版樉绀轰贡鐮乗n"); + printf(" 3.15 淇bug锛氬叧鏈轰粛鑳借緭鍏ュ瘑鐮乗n"); + printf(" 3.15 浼樺寲浣撻獙锛氬姞鍏ュ厜鏍囬殣钘忥紙鍏抽棴鍓嶅線init鍑芥暟绗竴琛岋級\n"); + printf(" 3.19 瀹屽杽鍔熻兘锛氬姞鍏ュ彲绉诲姩娓告垙绠娲佺増锛屽彲鑷埗鍦板浘锛屾柟娉曞墠寰婧愮▼搴弇y_map鏁扮粍澶勬煡鐪媆n"); + printf(" 4.07 瀹屽杽鍔熻兘锛氾紙妗岄潰杞欢鍏ㄩ儴鏇存柊锛屽姛鑳藉畬鍠勶紝鏇村姞璐磋繎xp绯荤粺銆傦級\n"); + printf(" 路瀵嗙爜杈撳叆浼樺寲锛岃緭鍏ョ殑瀵嗙爜浼氬湪涓嬩竴娆¤緭鍏ュ彉鎴愪笉鍙銆俓n"); + printf(" 路浼樺寲鎵撶爾鍧楀瑙掔鎾炵畻娉曪紝鏇村姞鐪熷疄銆俓n"); + printf(" 路鏂板鈥滄鐢佃剳鈥濆彲鏌ョ湅鐢佃剳閰嶇疆.\n"); + printf(" 路鏂板鍏虫満鐢婚潰銆俓n"); + printf(" 路鍔犲叆钃濆睆锛屾洿鍔犲揩涔愶紙鐐瑰嚮娴忚鍣ㄨЕ鍙戯級\n"); + printf(" 路浼樺寲鏇村缁嗚妭.\n\n"); + printf("銆愮▼搴忚ˉ鍏呫慭n"); + printf(" 路杩欓噷宸笉澶氭妸鍧戝~瀹屼簡锛屼箣鍓嶅弽搴旂殑瑕佹湁鑳芥搷鎺х殑娓告垙锛岃緭鍏ュ瘑鐮佸彲瑙佷笉鐪熷疄锛屽叧鏈虹敾闈㈡病妯℃嫙绛夌瓑\n"); + printf(" 路閮藉紕瀹屼簡锛岃嚦浜庣綉涓婂啿娴紝鎵搇ol锛屽啓缂栬瘧鍣ㄥ氨鏈夌敓涔嬪勾鍚с傚浜嗭紝鍥犳鎴戣繕鐗规剰鍔犲叆浜嗚摑灞忥紙婊戠ń锛夈俓n\n"); + printf("銆愮▼搴忚鏄庛慭n"); + printf(" 路鏈夐棶棰橈紝鏈塨ug锛屼笉鍏煎锛屾杩庡幓git鍙嶉浜ゆ祦\n"); + printf(" 路鎿嶄綔鏂规硶锛氣啈 鈫 鈫 鈫 绌烘牸 鎺у埗鍏夋爣鍗冲彲銆俓n"); + printf(" 路杩涘叆绋嬪簭鐢垫簮閿鎸変竴娆$┖鏍紎|杈撳叆瀵嗙爜WHJY鍗冲彲鐧诲綍||璇峰湪铏氭嫙閿洏涓婂紑鍚ぇ鍐欏啀杈撳叆||\n"); + printf(" 路娆㈣繋浣跨敤XP妯℃嫙绗旇鏈數鑴戯紒\n"); + printf(" 1.鎸変袱涓嬪洖杞﹁繘鍏ワ紙鏈兘瑙e喅bug绉诲姩鏃跺懆鍥村彲鑳戒細鏈夎摑鑹茬殑闂锛塡n"); + printf(" 2.鎸1鍐嶆寜鍥炶溅杩涘叆 锛堝紑鍚竻闄ら棯棰戯紝鍏夋爣鑳屾櫙鐢辫摑鑹插彉鎴愬簳鑹诧級\n"); ch = getchar(); getchar(); if (ch == '1') @@ -637,7 +637,7 @@ void init() } void init_start() -{ // 开机 + 动态加载页面 + 打开输入密码权限 +{ // 寮鏈 + 鍔ㄦ佸姞杞介〉闈 + 鎵撳紑杈撳叆瀵嗙爜鏉冮檺 int i, l, j; gotoxy(0, 0); for (i = 0; i <= 16; i++) @@ -647,7 +647,7 @@ void init_start() } for (l = 0; l < 3; l++) - { //动态加载 + { //鍔ㄦ佸姞杞 for (i = 53; i <= 71; i = i + 2) { for (j = i - 4; j <= i; j = j + 2) @@ -675,13 +675,13 @@ void init_start() printf("%s\n", password[i]); Sleep(10); } - if_input = 1; // 9 77 18个 + if_input = 1; // 9 77 18涓 input_x = 9; input_y = 77; input_max = 18; } void load_desktop() -{ //加载桌面 +{ //鍔犺浇妗岄潰 int i; cx = 1, cy = 1; if_into_desktop = 1; @@ -695,12 +695,12 @@ void load_desktop() } } void end() -{ //加载关机 +{ //鍔犺浇鍏虫満 int i; - char temp1[30] = {"| 正在注销.... |"}; - char temp2[30] = {"| Windows 正在关机...|"}; + char temp1[30] = {"| 姝e湪娉ㄩ攢.... |"}; + char temp2[30] = {"| Windows 姝e湪鍏虫満...|"}; system("color 70"); - //Windows 正在关机... + //Windows 姝e湪鍏虫満... gotoxy(0, 0); if_input = 0; gotoxy(0, 0); @@ -722,14 +722,14 @@ void end() Sleep(10); } } -void blue_screen() //蓝屏 +void blue_screen() //钃濆睆 { int i, j, l = 2, r = 122, hei = 16, len = 124; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 30); gotoxy(0, 0); if_into_desktop = 0; for (i = 1; i <= hei; i++) - { //打印地图 + { //鎵撳嵃鍦板浘 for (j = 0; j <= len; j++) { if (j >= l && j <= r) @@ -771,7 +771,7 @@ void my_computer() } void load_more() -{ //更多信息 +{ //鏇村淇℃伅 int i; gotoxy(0, 0); @@ -783,7 +783,7 @@ void load_more() } } void load_game() -{ //加载汉诺塔程序 +{ //鍔犺浇姹夎濉旂▼搴 int i; if_into_desktop = 0; gotoxy(0, 0); @@ -795,14 +795,14 @@ void load_game() } if_game = 1; gotoxy(mid_y - 16, mid_x); - printf("请输入你要递归的汉诺塔数目_"); + printf("璇疯緭鍏ヤ綘瑕侀掑綊鐨勬眽璇哄鏁扮洰_"); input_x = mid_x; input_y = mid_y - 16 + 27; input_max = 1; if_input = 1; } int move() -{ //控制虚拟键盘的指针移动函数 +{ //鎺у埗铏氭嫙閿洏鐨勬寚閽堢Щ鍔ㄥ嚱鏁 int i, k, flag = 1; char ch, ch1, ch2; while (ch != ' ') @@ -814,7 +814,7 @@ int move() continue; lx = x, ly = y; if (ch == -32) - { //同时启用wasd 和上下左右键 //如果读取到第一个是-32那么 继续读取一个字符 + { //鍚屾椂鍚敤wasd 鍜屼笂涓嬪乏鍙抽敭 //濡傛灉璇诲彇鍒扮涓涓槸-32閭d箞 缁х画璇诲彇涓涓瓧绗 ch1 = getch(); switch (ch1) { @@ -901,7 +901,7 @@ int move() } } -//----------------------------------------------------------------------------打砖块/----------------------------------------------------------------------------- +//----------------------------------------------------------------------------鎵撶爾鍧/----------------------------------------------------------------------------- void init_brick() { int l, r, i, j, a, b; @@ -911,8 +911,8 @@ void init_brick() width2 = 16, length2 = 124; wall = '#', food = '*', air = ' ', brick = 'O'; head2 = 0, tail2 = 0, max2 = 20, step2 = 0, if_miss = 0, food_num = 400, goal = 0, color = 0; - debug = 0, life = 3; //debug模式调成1手动开启 - temp_x2 = 2, temp_y2 = 2, menu_x = 18, menu_y = 68, left2 = 25, right2 = 35; //临时坐标 + debug = 0, life = 3; //debug妯″紡璋冩垚1鎵嬪姩寮鍚 + temp_x2 = 2, temp_y2 = 2, menu_x = 18, menu_y = 68, left2 = 25, right2 = 35; //涓存椂鍧愭爣 gotoxy(0, 0); memset(s, 0, sizeof(s)); r = length2; @@ -920,7 +920,7 @@ void init_brick() if (if_my_map == 0) { for (i = 0; i <= width2; i++) - { //生成地图模板 + { //鐢熸垚鍦板浘妯℃澘 for (j = 0; j <= length2; j++) { if (i == 0 || i == width2) @@ -941,7 +941,7 @@ void init_brick() { food_num = 400; while (food_num--) - { //贪吃蛇生成食物 + { //璐悆铔囩敓鎴愰鐗 a = rand() % width2; b = rand() % length2; if ((a >= width2 / 3 && a <= width2 * 2 / 3) && (b >= length2 * 2 / 5 && b <= length2 * 3 / 5) || a == 0 || b == 0) @@ -950,7 +950,7 @@ void init_brick() } } for (i = 0; i <= width2; i++) - { //布置砖块brick + { //甯冪疆鐮栧潡brick for (j = 0; j <= length2; j++) { if (((i >= width2 * 2 / 3 && i <= width2 * 2 / 3 + 1) && (j >= 0 && j <= length2 / 5)) || ((i >= width2 * 2 / 3 && i <= width2 * 2 / 3 + 1) && (j >= length2 * 4 / 5 && j <= length2))) @@ -971,7 +971,7 @@ void init_brick() l = 0; gotoxy(0, 0); for (i = 0; i <= width2; i++) - { //打印地图 + { //鎵撳嵃鍦板浘 for (j = 0; j <= length2; j++) { if (j >= l && j <= r) @@ -988,7 +988,7 @@ void init_brick() Sleep(50); printf("\n"); } - //构建初始位置以及速度和方向角度 + //鏋勫缓鍒濆浣嶇疆浠ュ強閫熷害鍜屾柟鍚戣搴 X2 = width2 - 6; Y2 = rand() % 5 + 23; old_x2 = (int)X2; @@ -996,13 +996,13 @@ void init_brick() s[step2].x2 = old_x2; s[step2].y2 = old_y2; V = 15; - Vx = -V * sin(C[3] * pi / 180.0); //速度向右向下为正方向 + Vx = -V * sin(C[3] * pi / 180.0); //閫熷害鍚戝彸鍚戜笅涓烘鏂瑰悜 Vy = V * cos(C[3] * pi / 180.0); gotoxy(4, 1); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); printf("life:"); for (i = 0; i < life; i++) - printf("■"); + printf("鈻"); } void end_brick() @@ -1018,7 +1018,7 @@ void end_brick() step2 += max2; gotoxy(s[step2].y2, s[step2].x2); map2[s[step2].x2][s[step2].y2]--; - if (map2[s[step2].x2][s[step2].y2] == air && !(s[step2].x2 == 0 && s[step2].y2 == 0)) //防止自己吃自己 + if (map2[s[step2].x2][s[step2].y2] == air && !(s[step2].x2 == 0 && s[step2].y2 == 0)) //闃叉鑷繁鍚冭嚜宸 printf("%c", air); s[step2].x2 = 0; s[step2].y2 = 0; @@ -1040,9 +1040,9 @@ void end_brick() if_into_desktop = 1; } -void manchange(char ch) //人为输入更新 +void manchange(char ch) //浜轰负杈撳叆鏇存柊 { - if (ch == 'a' || ch == 's' || ch == 'd' || ch == 'w' || ch == ' ' || ch == 'p' || ch == 'b') //目前只开放aswd + if (ch == 'a' || ch == 's' || ch == 'd' || ch == 'w' || ch == ' ' || ch == 'p' || ch == 'b') //鐩墠鍙紑鏀綼swd { if (ch == 'a' && map2[width2 - 1][left2 - 1] != wall) { @@ -1072,7 +1072,7 @@ void manchange(char ch) // else if (ch == 'p') { /*gotoxy(2, width2 + 5); - printf("游戏暂停,按'p'继续游戏"); + printf("娓告垙鏆傚仠锛屾寜'p'缁х画娓告垙"); ch2 = getch(); while (ch2 != 'p') { @@ -1089,7 +1089,7 @@ void manchange(char ch) // //function = move(&temp_x2,&temp_y2,0,width2,0,length2,1,1,ch); //function = move(&menu_x,&menu_y,18,24,68,68,2,0,ch); } -void autochange() //自动更新 +void autochange() //鑷姩鏇存柊 { int flag = 1, i; double t1, t2; @@ -1099,50 +1099,50 @@ void autochange() // double x2_t1; double x3_t1; double x4_t1; - //更具体请前往https://github.com/404name/winter 打砖块子目录下下载demo文件参考抛物线原理 - //这里的“轨迹”是存在“循环队列”的结构体中的 - //map数组一开始只打印一次,随后在原数组上的改变不会作用显示。 - //显示轨迹的其实还是打印空格,但不同的是颜色 - //消去轨迹也打印白色的空格:SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); + //鏇村叿浣撹鍓嶅線https://github.com/404name/winter 鎵撶爾鍧楀瓙鐩綍涓嬩笅杞絛emo鏂囦欢鍙傝冩姏鐗╃嚎鍘熺悊 + //杩欓噷鐨勨滆建杩光濇槸瀛樺湪鈥滃惊鐜槦鍒椻濈殑缁撴瀯浣撲腑鐨 + //map鏁扮粍涓寮濮嬪彧鎵撳嵃涓娆★紝闅忓悗鍦ㄥ師鏁扮粍涓婄殑鏀瑰彉涓嶄細浣滅敤鏄剧ず銆 + //鏄剧ず杞ㄨ抗鐨勫叾瀹炶繕鏄墦鍗扮┖鏍硷紝浣嗕笉鍚岀殑鏄鑹 + //娑堝幓杞ㄨ抗涔熸墦鍗扮櫧鑹茬殑绌烘牸锛歋etConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); /*------------------------------------------------------- - 核心公式: X = X0 + Vx * t + 1/2 * VX * t * t; + 鏍稿績鍏紡锛 X = X0 + Vx * t + 1/2 * VX * t * t; Y = Y0 + Vy * t; - 核心思想: ·如果选择时间作为移动参考,则每秒会出现点相差太远 - 难以实现连续。 - ·这里反过来,以连续为前提,尝试找出每移动一个单位 - 需要多少时间,则能依次找出一个连续的曲线。 + 鏍稿績鎬濇兂锛 路濡傛灉閫夋嫨鏃堕棿浣滀负绉诲姩鍙傝冿紝鍒欐瘡绉掍細鍑虹幇鐐圭浉宸お杩 + 闅句互瀹炵幇杩炵画銆 + 路杩欓噷鍙嶈繃鏉ワ紝浠ヨ繛缁负鍓嶆彁锛屽皾璇曟壘鍑烘瘡绉诲姩涓涓崟浣 + 闇瑕佸灏戞椂闂达紝鍒欒兘渚濇鎵惧嚭涓涓繛缁殑鏇茬嚎銆 - 出现问题: c语言数组只能是整数,所以移动方向只能存在水平和竖直, - 不能依照运动方向实现往某个特定的角度移动一个单位。 - 并且要排除断节问题(即打印的曲线断断续续) + 鍑虹幇闂锛 c璇█鏁扮粍鍙兘鏄暣鏁帮紝鎵浠ョЩ鍔ㄦ柟鍚戝彧鑳藉瓨鍦ㄦ按骞冲拰绔栫洿锛 + 涓嶈兘渚濈収杩愬姩鏂瑰悜瀹炵幇寰鏌愪釜鐗瑰畾鐨勮搴︾Щ鍔ㄤ竴涓崟浣嶃 + 骞朵笖瑕佹帓闄ゆ柇鑺傞棶棰橈紙鍗虫墦鍗扮殑鏇茬嚎鏂柇缁画锛 - 解决方法: 把特移动方向移动单位分解到X,Y上。 - 分别算出 X 增加一个单位长度 应该增加的 Y 的距离 s1 <=> flag == 1 - Y 增加一个单位长度 应该增加的 X 的距离 s2 <=> flag == 2 + 瑙e喅鏂规硶锛 鎶婄壒绉诲姩鏂瑰悜绉诲姩鍗曚綅鍒嗚В鍒癤锛孻涓娿 + 鍒嗗埆绠楀嚭 X 澧炲姞涓涓崟浣嶉暱搴 搴旇澧炲姞鐨 Y 鐨勮窛绂 s1 <=> flag == 1 + Y 澧炲姞涓涓崟浣嶉暱搴 搴旇澧炲姞鐨 X 鐨勮窛绂 s2 <=> flag == 2 - 优先选择更短的min(s1,s2),然后以flag对应不同的模式作为下一次移动的基准。 - 这样操作能保证线段仅仅只在水平与竖直方向移动时线段仍能连续 + 浼樺厛閫夋嫨鏇寸煭鐨刴in锛坰1,s2),鐒跺悗浠lag瀵瑰簲涓嶅悓鐨勬ā寮忎綔涓轰笅涓娆$Щ鍔ㄧ殑鍩哄噯銆 + 杩欐牱鎿嶄綔鑳戒繚璇佺嚎娈典粎浠呭彧鍦ㄦ按骞充笌绔栫洿鏂瑰悜绉诲姩鏃剁嚎娈典粛鑳借繛缁 - 打个比方:一段斜率为2的直线 - x增加1 Y增加2你看,这里Y脱节了会一下子在Y上移动了2格。 - 但实际上我们看 - Y增加1 X实际上只增加0.5. - 所以一段曲线,他的微元构成的直线不管斜率多偏僻,都能连续打印。 - 这就是为什么取min(s1,s2)决定移动模式的原因。 - 这样能保证仅仅只在上移动一个单位int(Y),而int(X)是不增加的,浮点型的X又把量累计到下一次在判断。 + 鎵撲釜姣旀柟锛氫竴娈垫枩鐜囦负2鐨勭洿绾 + x澧炲姞1 Y澧炲姞2浣犵湅锛岃繖閲孻鑴辫妭浜嗕細涓涓嬪瓙鍦╕涓婄Щ鍔ㄤ簡2鏍笺 + 浣嗗疄闄呬笂鎴戜滑鐪 + Y澧炲姞1 X瀹為檯涓婂彧澧炲姞0.5. + 鎵浠ヤ竴娈垫洸绾匡紝浠栫殑寰厓鏋勬垚鐨勭洿绾夸笉绠℃枩鐜囧鍋忓兓锛岄兘鑳借繛缁墦鍗般 + 杩欏氨鏄负浠涔堝彇min锛坰1,s2锛夊喅瀹氱Щ鍔ㄦā寮忕殑鍘熷洜銆 + 杩欐牱鑳戒繚璇佷粎浠呭彧鍦ㄤ笂绉诲姩涓涓崟浣峣nt锛圷锛夛紝鑰宨nt锛圶锛夋槸涓嶅鍔犵殑锛屾诞鐐瑰瀷鐨刋鍙堟妸閲忕疮璁″埌涓嬩竴娆″湪鍒ゆ柇銆 - 最后实现: - X,Y用double储存,保证实际叠加能连续; - 而实际打印,是不能说(5,6.28)这样的浮点型能在c语言上打印,所以我们采用int整型的old_x,old_y来承接X,Y以便于打印在屏幕上。 + 鏈鍚庡疄鐜帮細 + X锛孻鐢╠ouble鍌ㄥ瓨锛屼繚璇佸疄闄呭彔鍔犺兘杩炵画锛 + 鑰屽疄闄呮墦鍗帮紝鏄笉鑳借锛5,6.28锛夎繖鏍风殑娴偣鍨嬭兘鍦╟璇█涓婃墦鍗帮紝鎵浠ユ垜浠噰鐢╥nt鏁村瀷鐨刼ld_x,old_y鏉ユ壙鎺锛孻浠ヤ究浜庢墦鍗板湪灞忓箷涓娿 - 我们按照时间为循环只能在屏幕上打印一串断断续续的类抛物线的点。 - 但我们按照走一个“方向单位”,依次类叠,我们就能得到一串连续的线。 + 鎴戜滑鎸夌収鏃堕棿涓哄惊鐜彧鑳藉湪灞忓箷涓婃墦鍗颁竴涓叉柇鏂画缁殑绫绘姏鐗╃嚎鐨勭偣銆 + 浣嗘垜浠寜鐓ц蛋涓涓滄柟鍚戝崟浣嶁濓紝渚濇绫诲彔锛屾垜浠氨鑳藉緱鍒颁竴涓茶繛缁殑绾裤 - 结果实现: 由于,算法偏向不严谨,可能会出现小部分开局断节bug,但随着循环推迟,后期能100%连续!! + 缁撴灉瀹炵幇锛 鐢变簬锛岀畻娉曞亸鍚戜笉涓ヨ皑锛屽彲鑳戒細鍑虹幇灏忛儴鍒嗗紑灞鏂妭bug锛屼絾闅忕潃寰幆鎺ㄨ繜锛屽悗鏈熻兘100%杩炵画锛侊紒 - 加入人为修正 + 鍔犲叆浜轰负淇 - 经测试小范围的数据能完美打印出物理抛物线!!! + 缁忔祴璇曞皬鑼冨洿鐨勬暟鎹兘瀹岀編鎵撳嵃鍑虹墿鐞嗘姏鐗╃嚎锛侊紒锛 ------------------------------------------------------------*/ x1_t1 = (-Vx + sqrt(Vx * Vx + 20)) / 10; @@ -1161,7 +1161,7 @@ void autochange() // temp = 10; t1 = t1 < temp ? t1 : temp; s1 = t1 * Vy; - //当Y2增加一个单位方向时 + //褰揧2澧炲姞涓涓崟浣嶆柟鍚戞椂 t2 = 1.0 / fabs(Vy); s2 = Vx * t2 + 0.5 * g * t2 * t2; if ((int)s1 == 0) @@ -1171,7 +1171,7 @@ void autochange() // else flag = s1 < s2 ? 1 : 2; - //选择最优进行处理 + //閫夋嫨鏈浼樿繘琛屽鐞 if (flag == 1) { X2 = X2 + Vx * t1 + 5 * t1 * t1; @@ -1186,14 +1186,14 @@ void autochange() // } /*else{ for( i = 0; i < 4; i++) - 放弃判断对角了选择其他方式解决(详细见开头注释) + 鏀惧純鍒ゆ柇瀵硅浜嗛夋嫨鍏朵粬鏂瑰紡瑙e喅锛堣缁嗚寮澶存敞閲婏級 } } */ //--------------------------------- old_x2 = (int)X2; old_y2 = (int)Y2; - //常规的判断碰撞 + //甯歌鐨勫垽鏂鎾 if (map2[old_x2 + 1][old_y2] == wall && Vx >= 0 && map2[old_x2][old_y2 + 1] != wall && map2[old_x2][old_y2 - 1] != wall) { color = (color + 1) % 5; @@ -1270,7 +1270,7 @@ void autochange() // } else if (map2[old_x2 + 1][old_y2 + 1] == brick && Vx > 0 && Vy > 0 || map2[old_x2 + 1][old_y2 - 1] == brick && Vx > 0 && Vy < 0 || map2[old_x2 - 1][old_y2 + 1] == brick && Vx < 0 && Vy > 0 || map2[old_x2 - 1][old_y2 - 1] == brick && Vx < 0 && Vy < 0) { - color = (color + 1) % 5; //对角碰改变颜色方便区分 + color = (color + 1) % 5; //瀵硅纰版敼鍙橀鑹叉柟渚垮尯鍒 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); if (Vx > 0 && Vy > 0) { @@ -1323,7 +1323,7 @@ void autochange() // SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 07); gotoxy(s[step2].y2, s[step2].x2); map2[s[step2].x2][s[step2].y2]--; - if (map2[s[step2].x2][s[step2].y2] == air && !(s[step2].x2 == 0 && s[step2].y2 == 0)) //防止自己吃自己 + if (map2[s[step2].x2][s[step2].y2] == air && !(s[step2].x2 == 0 && s[step2].y2 == 0)) //闃叉鑷繁鍚冭嚜宸 printf("%c", air); } s[step2].x2 = old_x2; @@ -1337,19 +1337,19 @@ void autochange() // { case 0: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 60); - break; //蓝色 + break; //钃濊壊 case 1: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 70); - break; //红色 + break; //绾㈣壊 case 2: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 40); - break; //绿色 + break; //缁胯壊 case 3: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 30); - break; //深蓝色 + break; //娣辫摑鑹 case 4: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 128); - break; //紫色 + break; //绱壊 } gotoxy(s[step2].y2, s[step2].x2); if (map2[s[step2].x2][s[step2].y2] == brick) @@ -1360,7 +1360,7 @@ void autochange() // if (debug == 0 && !(s[step2].x2 == 0 && s[step2].y2 == 0)) printf("%c", air); else - printf("%d", step2 % 10); //debug模式 + printf("%d", step2 % 10); //debug妯″紡 step2++; if (step2 >= max2) { @@ -1376,7 +1376,7 @@ void autochange() // cnt = 0; color = (color + 1) % 5; } - Sleep(150 - 2 * old_x2); //模拟下坠的时候速度加快--对应画面更新更快 + Sleep(150 - 2 * old_x2); //妯℃嫙涓嬪潬鐨勬椂鍊欓熷害鍔犲揩--瀵瑰簲鐢婚潰鏇存柊鏇村揩 if (map[old_x2][old_y2] == wall) { Vx = -Vx; @@ -1392,10 +1392,10 @@ void autochange() // end_brick(); } } -//-----------------------------------------------------------------------------打砖块/----------------------------------------------------------------------------- +//-----------------------------------------------------------------------------鎵撶爾鍧/----------------------------------------------------------------------------- void put_letter_to_computer(char letter) -{ //把字符传输给电脑屏幕,如果电脑if_input为零就禁止显示 +{ //鎶婂瓧绗︿紶杈撶粰鐢佃剳灞忓箷锛屽鏋滅數鑴慽f_input涓洪浂灏辩姝㈡樉绀 int i; if (if_input == 1 && put_in_num < input_max) { @@ -1418,11 +1418,11 @@ void put_letter_to_computer(char letter) printf("%s", put_in_computer); } void put_function_to_computer(int function) -{ //电脑处理相应共呢 1 ~ 返回 2 ~删除 3确认 4shift 5上 6左 7下 8又 9开机 +{ //鐢佃剳澶勭悊鐩稿簲鍏卞憿 1 ~ 杩斿洖 2 ~鍒犻櫎 3纭 4shift 5涓 6宸 7涓 8鍙 9寮鏈 int ncx, ncy; char ch; if (function == 9) - { //开机 + { //寮鏈 system("color 70"); if (if_start == 0) { @@ -1441,7 +1441,7 @@ void put_function_to_computer(int function) } } if (function == 2 && put_in_num > 0 && if_input == 1) - { //删除字符,但不可越界 + { //鍒犻櫎瀛楃锛屼絾涓嶅彲瓒婄晫 put_in_num--; put_in_computer[put_in_num] = '\0'; if (if_input_password == 1) @@ -1457,14 +1457,14 @@ void put_function_to_computer(int function) } } if (function == 4) - { //切换大小写 + { //鍒囨崲澶у皬鍐 if (if_shift) if_shift = 0; else if_shift = 1; } if (function == 3 && if_input == 1 && if_game == 0) - { //确认对应不同模式下的不同功能 + { //纭瀵瑰簲涓嶅悓妯″紡涓嬬殑涓嶅悓鍔熻兘 if (strcmp(password_0, put_in_computer) == 0) { if_input_password = 0; @@ -1478,7 +1478,7 @@ void put_function_to_computer(int function) put_in_num = 0; put_in_computer[put_in_num] = '\0'; gotoxy(input_y, input_x); - printf("密 码 错 误 !!!"); + printf("瀵 鐮 閿 璇 锛侊紒锛"); gotoxy(input_y, input_x); Sleep(1200); printf(" "); @@ -1511,10 +1511,10 @@ void put_function_to_computer(int function) put_in_num = 0; put_in_computer[0] = '\0'; } - //if(if_game == 1 && function >= 5 && function <= 8)) 移动类型游戏暂未开放 (3.19更新可用了) + //if(if_game == 1 && function >= 5 && function <= 8)) 绉诲姩绫诲瀷娓告垙鏆傛湭寮鏀 (3.19鏇存柊鍙敤浜) else if (if_game == 2 && function >= 5 && function <= 8) { - //5上 6左 7下 8又 + //5涓 6宸 7涓 8鍙 ch = 'a'; switch (function) { @@ -1536,12 +1536,12 @@ void put_function_to_computer(int function) } else if (function == 3 && if_into_desktop) { - if (computer_map[cx][cy] == 1) //1 - 汉诺塔 2 - 打砖块 + if (computer_map[cx][cy] == 1) //1 - 姹夎濉 2 - 鎵撶爾鍧 { load_game(); if_game = 1; } - else if (computer_map[cx][cy] == 2) //打砖块 + else if (computer_map[cx][cy] == 2) //鎵撶爾鍧 { if_into_desktop = 0; init_brick(); @@ -1549,10 +1549,10 @@ void put_function_to_computer(int function) system("color 07"); } else if (computer_map[cx][cy] == 3) - { //(我的电脑) + { //锛堟垜鐨勭數鑴戯級 my_computer(); } - else if (computer_map[cx][cy] == 4) // 更多信息 + else if (computer_map[cx][cy] == 4) // 鏇村淇℃伅 { load_more(); getch(); @@ -1561,7 +1561,7 @@ void put_function_to_computer(int function) load_desktop(); } else if (computer_map[cx][cy] == 5) - { //浏览器(因为不支持,所以使用就蓝屏(滑稽)) + { //娴忚鍣紙鍥犱负涓嶆敮鎸侊紝鎵浠ヤ娇鐢ㄥ氨钃濆睆锛堟粦绋斤級锛 blue_screen(); } } @@ -1581,37 +1581,37 @@ void put_function_to_computer(int function) } } if (function == 1 && if_into_desktop) - { //返回 + { //杩斿洖 load_desktop(); } } int main() { - if_my_map = 0; //是否加载自己设置的关卡,改成1后 my_map数组就是内置地图 + if_my_map = 0; //鏄惁鍔犺浇鑷繁璁剧疆鐨勫叧鍗★紝鏀规垚1鍚 my_map鏁扮粍灏辨槸鍐呯疆鍦板浘 HideCursor(); init(); - /*load_desktop(); //直接进入桌面 + /*load_desktop(); //鐩存帴杩涘叆妗岄潰 if_start = 1; if_into_desktop = 1;*/ HideCursor(); while (1) - { //主循环w - if (if_game == 2) //打砖块 + { //涓诲惊鐜痺 + if (if_game == 2) //鎵撶爾鍧 autochange(); if (kbhit()) { - flag = move(); //move提取读取的键盘按键并判断类型 + flag = move(); //move鎻愬彇璇诲彇鐨勯敭鐩樻寜閿苟鍒ゆ柇绫诲瀷 switch (flag) { case 0: - break; //暂无效果的按键 + break; //鏆傛棤鏁堟灉鐨勬寜閿 case 1: put_letter_to_computer(letter); - break; //返回字符型按键给电脑 + break; //杩斿洖瀛楃鍨嬫寜閿粰鐢佃剳 case 2: put_function_to_computer(function); - break; //返回功能型按键给电脑 + break; //杩斿洖鍔熻兘鍨嬫寜閿粰鐢佃剳 } } } diff --git "a/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254\357\274\210\347\273\217\345\205\270\347\256\200\346\264\201\347\211\210\357\274\211/win10\347\211\210/\347\250\213\345\272\217\346\226\207\344\273\266.c" "b/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254\357\274\210\347\273\217\345\205\270\347\256\200\346\264\201\347\211\210\357\274\211/win10\347\211\210/\347\250\213\345\272\217\346\226\207\344\273\266.c" index 66d0ad2..ba517bb 100644 --- "a/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254\357\274\210\347\273\217\345\205\270\347\256\200\346\264\201\347\211\210\357\274\211/win10\347\211\210/\347\250\213\345\272\217\346\226\207\344\273\266.c" +++ "b/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254/\346\250\241\346\213\237\347\254\224\350\256\260\346\234\254\357\274\210\347\273\217\345\205\270\347\256\200\346\264\201\347\211\210\357\274\211/win10\347\211\210/\347\250\213\345\272\217\346\226\207\344\273\266.c" @@ -1,26 +1,26 @@ /*--------------------------------------------------------- -用VC的一定要选则 Win32 Console Application工程 +鐢╒C鐨勪竴瀹氳閫夊垯 Win32 Console Application宸ョ▼ -2.25最新版本 -未加入新功能 -修复了一些bug,适配了所有编译器。。。 -可直接运行exe或者赋值。 +2.25鏈鏂扮増鏈 +鏈姞鍏ユ柊鍔熻兘 +淇浜嗕竴浜沚ug锛岄傞厤浜嗘墍鏈夌紪璇戝櫒銆傘傘 +鍙洿鎺ヨ繍琛宔xe鎴栬呰祴鍊笺 -程序: 模拟笔记本电脑 (纯C语言,可直接编译器运行) -作者: 0.0 -说明: 1.这个程序本意在模拟电脑的基本功能,重在实现键盘的输入与键盘的控制,模拟开机,输密,打开软件,关闭电脑,所以其他功能暂没开发,不用太失望。 - 2.不同的编码会有不同的长度显示,但运行出来的效果都是一样的 - 3.代码规范不到位,见谅。 - 4.大一上写的,一般写小游戏练手,也琢磨到一些特殊的处理方法,所以对一些功能处理上有一些难理解的地方。 - 5.emmm,没啥了 +绋嬪簭锛 妯℃嫙绗旇鏈數鑴 锛堢函C璇█锛屽彲鐩存帴缂栬瘧鍣ㄨ繍琛岋級 +浣滆咃細 0.0 +璇存槑锛 1.杩欎釜绋嬪簭鏈剰鍦ㄦā鎷熺數鑴戠殑鍩烘湰鍔熻兘锛岄噸鍦ㄥ疄鐜伴敭鐩樼殑杈撳叆涓庨敭鐩樼殑鎺у埗锛屾ā鎷熷紑鏈猴紝杈撳瘑锛屾墦寮杞欢锛屽叧闂數鑴戯紝鎵浠ュ叾浠栧姛鑳芥殏娌″紑鍙戯紝涓嶇敤澶け鏈涖 + 2.涓嶅悓鐨勭紪鐮佷細鏈変笉鍚岀殑闀垮害鏄剧ず锛屼絾杩愯鍑烘潵鐨勬晥鏋滈兘鏄竴鏍风殑 + 3.浠g爜瑙勮寖涓嶅埌浣嶏紝瑙佽皡銆 + 4.澶т竴涓婂啓鐨勶紝涓鑸啓灏忔父鎴忕粌鎵嬶紝涔熺悽纾ㄥ埌涓浜涚壒娈婄殑澶勭悊鏂规硶锛屾墍浠ュ涓浜涘姛鑳藉鐞嗕笂鏈変竴浜涢毦鐞嗚В鐨勫湴鏂广 + 5.emmm锛屾病鍟ヤ簡 ---------------------------------------------------------*/ -#include //用于getch() +#include //鐢ㄤ簬getch锛堬級 #include #include #include -char start[20][300] = { //图形界面 - {"┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"}, +char start[20][300] = { //鍥惧舰鐣岄潰 + {"鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, {" \\ /"}, {" \\ /"}, {" \\ /"}, @@ -32,50 +32,50 @@ {" \\ \\/ \\/ | | | |_| |_| \\/\\/ __/ /"}, {" \\ /"}, {" \\ _____________________ /"}, - {" \\ │ │ /"}, - {" \\ └────────────────────┘ /"}, + {" \\ 鈹 鈹 /"}, + {" \\ 鈹斺攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 /"}, {" \\ /"}, - {" \\ Copyright ΘMicrosoft Corporation Microsoft* /"}, + {" \\ Copyright 螛Microsoft Corporation Microsoft* /"}, {" \\ __________________________________________________________________________________________/"}}; char password[20][300] = { - {"┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"}, + {"鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, {" \\ /"}, {" \\ ------------------------------------------------------------------------------------------------------------------ /"}, {" \\ /"}, {" \\ | /"}, {" \\ | /"}, - {" \\ | ┌───────────────────────────────────────────── /"}, - {" \\ /~/~/ | │┌─────┐ Administrator /"}, - {" \\ /~/~/ __XP | ││ [] │ 输入密码 /"}, - {" \\ \\ /\\ / - _ _| _ ~ ~ /_ | │└─────┘ 【| 】ck[→] /"}, - {" \\ \\/ \\/ | | | |_| |_| \\/\\/ __/ | └─────────────────────────────────────── /"}, + {" \\ | 鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 /"}, + {" \\ /~/~/ | 鈹傗攲鈹鈹鈹鈹鈹鈹 Administrator /"}, + {" \\ /~/~/ __XP | 鈹傗攤 [] 鈹 杈撳叆瀵嗙爜 /"}, + {" \\ \\ /\\ / - _ _| _ ~ ~ /_ | 鈹傗敂鈹鈹鈹鈹鈹鈹 銆恷 銆慶k[鈫抅 /"}, + {" \\ \\/ \\/ | | | |_| |_| \\/\\/ __/ | 鈹斺攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 /"}, {" \\ | /"}, - {" \\ 要开始,请单击您的用户名 | /"}, + {" \\ 瑕佸紑濮嬶紝璇峰崟鍑绘偍鐨勭敤鎴峰悕 | /"}, {" \\ | /"}, {" \\ /"}, {" \\ ---------------------------------------------------------------------------------------- /"}, {" \\ __________________________________________________________________________________________/"}}; char desktop[20][300] = { - {"┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"}, - {" \\ ───── ───── ───── ┌────┐ ┌────┐ /"}, - {" \\ \\ [] \\ \\ \\ \\ \\ │ │ │ing │ /"}, - {" \\ ───── ───── ───── └────┘ └────┘ /"}, - {" \\ 小游戏 垃圾桶 计算器 相关 待开发 /"}, - {" \\ ───── /"}, + {"鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, + {" \\ 鈹鈹鈹鈹鈹 鈹鈹鈹鈹鈹 鈹鈹鈹鈹鈹 鈹屸攢鈹鈹鈹鈹 鈹屸攢鈹鈹鈹鈹 /"}, + {" \\ \\ [] \\ \\ \\ \\ \\ 鈹 鈹 鈹俰ng 鈹 /"}, + {" \\ 鈹鈹鈹鈹鈹 鈹鈹鈹鈹鈹 鈹鈹鈹鈹鈹 鈹斺攢鈹鈹鈹鈹 鈹斺攢鈹鈹鈹鈹 /"}, + {" \\ 灏忔父鎴 鍨冨溇妗 璁$畻鍣 鐩稿叧 寰呭紑鍙 /"}, + {" \\ 鈹鈹鈹鈹鈹 /"}, {" \\ \\ \\ /"}, - {" \\ ───── __ --------------- __ __ /"}, - {" \\ IE浏览器__-- --- __ -------_ -------_------____ /"}, + {" \\ 鈹鈹鈹鈹鈹 __ --------------- __ __ /"}, + {" \\ IE娴忚鍣╛_-- --- __ -------_ -------_------____ /"}, {" \\ ____ __--__ -- __ -------_ --- - __ --- __ --------------______ /"}, {" \\__ -------_--__ ------- __ ---------- __ ------ __ ------ __ --- __ ---------____ /"}, {" \\ -------_---__ ------- _---- __ -------_ ---_ -------_ -_ ----------_ -_---_ -_ ------_ -_ /"}, {" \\--__ -- __ ----- __ ------ __ -------_ --- ---- __ -------_ -_ ---------_ -_ ------_ -_ ------ /"}, {" \\ -_--__ ------- _---- __ -------_ ------- __ -------_ -- __ -------_ -_ --------__---_ -_ ------/"}, {" \\ _____________________________________________________________________________________________ /"}, - {" \\ 开始 \\ qq2010 | | 12:00 /"}, + {" \\ 寮濮 \\ qq2010 | | 12:00 /"}, {" \\ __________________________________________________________________________________________/"}}; char game_hnt[20][300] = { - {"┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"}, - {" \\ ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ /"}, + {"鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, + {" \\ 鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 /"}, {" \\ /"}, {" \\ /"}, {" \\ /"}, @@ -87,48 +87,48 @@ char game_hnt[20][300] = { {" \\ /"}, {" \\ /"}, {" \\ /"}, - {" \\ └───────────────────────────────────────────────────────────────────────────────────────────┘ /"}, + {" \\ 鈹斺攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 /"}, {" \\ _____________________________________________________________________________________________ /"}, - {" \\ 开始 \\ qq2010 | 汉诺塔自动演示小游戏 | | 12:08 /"}, + {" \\ 寮濮 \\ qq2010 | 姹夎濉旇嚜鍔ㄦ紨绀哄皬娓告垙 | | 12:08 /"}, {" \\ __________________________________________________________________________________________/"}}; char thinking[30][300] = { - {"┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"}, - {" \\ ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ /"}, - {" \\ 这里是感想: /"}, + {"鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, + {" \\ 鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 /"}, + {" \\ 杩欓噷鏄劅鎯筹細 /"}, {" \\ /"}, - {" \\ 寒假太颓废了,没劲学习,游戏玩腻,然后开始发呆。安静下来时才有灵感 ,看着笔记本,就想着我也编一个电脑系统吧 /"}, + {" \\ 瀵掑亣澶搴熶簡锛屾病鍔插涔狅紝娓告垙鐜╄吇锛岀劧鍚庡紑濮嬪彂鍛嗐傚畨闈欎笅鏉ユ椂鎵嶆湁鐏垫劅 锛岀湅鐫绗旇鏈紝灏辨兂鐫鎴戜篃缂栦竴涓數鑴戠郴缁熷惂 /"}, {" \\ /"}, - {" \\ 就想把大一上学到的一些东西总着来练练手。。然后发现写电脑系统就是痴人说梦了,我还是写个模拟计算机吧。 /"}, + {" \\ 灏辨兂鎶婂ぇ涓涓婂鍒扮殑涓浜涗笢瑗挎荤潃鏉ョ粌缁冩墜銆傘傜劧鍚庡彂鐜板啓鐢佃剳绯荤粺灏辨槸鐥翠汉璇存ⅵ浜嗭紝鎴戣繕鏄啓涓ā鎷熻绠楁満鍚с /"}, {" \\ /"}, - {" \\ 对着自己笔记本的键盘一个一个的还原,然后思考如何体现屏幕,如何移动键盘,如何读取键盘把信息传给我的 /"}, + {" \\ 瀵圭潃鑷繁绗旇鏈殑閿洏涓涓竴涓殑杩樺師锛岀劧鍚庢濊冨浣曚綋鐜板睆骞曪紝濡備綍绉诲姩閿洏锛屽浣曡鍙栭敭鐩樻妸淇℃伅浼犵粰鎴戠殑 /"}, {" \\ /"}, - {" \\ 虚拟电脑,如何模拟开机实现基本功能 ,一口气写完真心爽,最后想做互动游戏的,但这斜着的屏幕,emmm /"}, + {" \\ 铏氭嫙鐢佃剳锛屽浣曟ā鎷熷紑鏈哄疄鐜板熀鏈姛鑳 锛屼竴鍙f皵鍐欏畬鐪熷績鐖斤紝鏈鍚庢兂鍋氫簰鍔ㄦ父鎴忕殑锛屼絾杩欐枩鐫鐨勫睆骞曪紝emmm /"}, {" \\ /"}, - {" \\ 所以最后电脑只能运行汉诺塔,其他功能实现也简单,但还是把时间放在我突然又燃起的学习小火苗上吧/"}, - {" \\ └───────────────────────────────────────────────────────────────────────────────────────────┘ /"}, + {" \\ 鎵浠ユ渶鍚庣數鑴戝彧鑳借繍琛屾眽璇哄锛屽叾浠栧姛鑳藉疄鐜颁篃绠鍗曪紝浣嗚繕鏄妸鏃堕棿鏀惧湪鎴戠獊鐒跺張鐕冭捣鐨勫涔犲皬鐏嫍涓婂惂/"}, + {" \\ 鈹斺攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 /"}, {" \\ _____________________________________________________________________________________________ /"}, - {" \\ 开始 \\ qq2010 | 感想.txt | | 12:15 /"}, + {" \\ 寮濮 \\ qq2010 | 鎰熸兂.txt | | 12:15 /"}, {" \\ __________________________________________________________________________________________/"}}; char ending[30][300] = { - {"┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"}, + {"鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, {" \\ /"}, - {" \\ 正在关机 /"}, + {" \\ 姝e湪鍏虫満 /"}, {" \\ /"}, - {" \\ 请确保你的数据已保存 /"}, + {" \\ 璇风‘淇濅綘鐨勬暟鎹凡淇濆瓨 /"}, {" \\ /"}, {" \\ 0.0 /"}, {" \\ /"}, - {" \\ 正在损失数据 /"}, + {" \\ 姝e湪鎹熷け鏁版嵁 /"}, {" \\ /"}, - {" \\ 电脑格式化成功 /"}, + {" \\ 鐢佃剳鏍煎紡鍖栨垚鍔 /"}, {" \\ /"}, - {" \\ 感谢使用 Xp /"}, + {" \\ 鎰熻阿浣跨敤 Xp /"}, {" \\ /"}, {" \\ /"}, {" \\ /"}, {" \\ __________________________________________________________________________________________/"}}; char map[10000][2000] = { - {"┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"}, + {"鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, {" \\ /"}, {" \\ /"}, {" \\ /"}, @@ -145,32 +145,32 @@ char map[10000][2000] = { {" \\ /"}, {" \\ /"}, {" \\ __________________________________________________________________________________________/"}, - {" ┌──────────────────────────────────────────────────────────────────────────────────────────┐"}, - {" │ ──── │"}, - {" │──────────────────────────────────────────────────────────────────────────────────────────│"}, - {" │┌─────┐ ┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┐ │"}, - {" ││ Esc │ │ F1│ F2│ F3│ F4││ F5│ F6│ F7│ F8││ F9│F10│F11│F12││Prt│Scr│Pau│ ┌┐ ┌┐ ┌┐ ┌┐ │"}, - {" │└─────┘ └───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┘ └┘ └┘ └┘ └┘ │"}, - {" │┌────┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐┌───┬───┬───┐┌───┬───┬───┬───┐│"}, - {" ││ `~ │ 1!│ 2@│ 3#│ 4$│ 5%│ 6^│ 7&│ 8*│ 9(│ 0)│ -─│ =+│ ←--││Ins│Hom│Pgu││Num│ / │ * │ - ││"}, - {" │├────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬────┤├───┼───┼───┤├───┼───┼───┼───┤│"}, - {" ││ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [{│ ]}│ \\| ││Del│End│Pgd││ 7 │ 8 │ 9 │ ││"}, - {" │├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴────┤└───┴───┴───┘├───┼───┼───┤ + ││"}, - {" ││ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ;:│ \'\"│ Enter │ │ 4 │ 5 │ 6 │ ││"}, - {" │├──────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───────┤ ┌───┐ ├───┼───┼───┼───┤│"}, - {" ││ Shift │ Z │ X │ C │ V │ B │ N │ M │ ,<│ .>│ /?│ Shift │ │ ↑│ │ 1 │ 2 │ 3 │ │││"}, - {" │├────┬──┴─┬─┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───╪───┬──────┤┌───┼───┼───┐├───┴───┼───┤ │││"}, - {" ││ Ctr│ win│ Alt│ ──── │ Alt│ Fn│ Ctrl ││← │ ↓│ →││ 0ins │.de│←┘││"}, - {" │└────┴────┴────┴───────────────────────────┴────┴───┴──────┘└───┴───┴───┘└───────┴───┴───┘│"}, - {" │ ┌───────────────────────────────┐ │"}, - {" │ │ │ │"}, - {" │ │ │ │"}, - {" │ │───────────────┬───────────────│ │"}, - {" │ └───────────────┴───────────────┘ │"}, - {" └──────────────────────────────────────────────────────────────────────────────────────────┘"}}; -//功能数组 + {" 鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, + {" 鈹 鈹鈹鈹鈹 鈹"}, + {" 鈹傗攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}, + {" 鈹傗攲鈹鈹鈹鈹鈹鈹 鈹屸攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹愨攲鈹鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹愨攲鈹鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹愨攲鈹鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹 鈹"}, + {" 鈹傗攤 Esc 鈹 鈹 F1鈹 F2鈹 F3鈹 F4鈹傗攤 F5鈹 F6鈹 F7鈹 F8鈹傗攤 F9鈹侳10鈹侳11鈹侳12鈹傗攤Prt鈹係cr鈹侾au鈹 鈹屸攼 鈹屸攼 鈹屸攼 鈹屸攼 鈹"}, + {" 鈹傗敂鈹鈹鈹鈹鈹鈹 鈹斺攢鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹樷敂鈹鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹樷敂鈹鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹樷敂鈹鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹 鈹斺敇 鈹斺敇 鈹斺敇 鈹斺敇 鈹"}, + {" 鈹傗攲鈹鈹鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹鈹鈹愨攲鈹鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹愨攲鈹鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹攢鈹鈹鈹愨攤"}, + {" 鈹傗攤 `~ 鈹 1!鈹 2@鈹 3#鈹 4$鈹 5%鈹 6^鈹 7&鈹 8*鈹 9(鈹 0)鈹 -鈹鈹 =+鈹 鈫--鈹傗攤Ins鈹侶om鈹侾gu鈹傗攤Num鈹 / 鈹 * 鈹 - 鈹傗攤"}, + {" 鈹傗敎鈹鈹鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹鈹鈹も敎鈹鈹鈹鈹尖攢鈹鈹鈹尖攢鈹鈹鈹も敎鈹鈹鈹鈹尖攢鈹鈹鈹尖攢鈹鈹鈹尖攢鈹鈹鈹も攤"}, + {" 鈹傗攤 Tab 鈹 Q 鈹 W 鈹 E 鈹 R 鈹 T 鈹 Y 鈹 U 鈹 I 鈹 O 鈹 P 鈹 [{鈹 ]}鈹 \\| 鈹傗攤Del鈹侲nd鈹侾gd鈹傗攤 7 鈹 8 鈹 9 鈹 鈹傗攤"}, + {" 鈹傗敎鈹鈹鈹鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹攢鈹鈹鈹鈹も敂鈹鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹樷敎鈹鈹鈹鈹尖攢鈹鈹鈹尖攢鈹鈹鈹 + 鈹傗攤"}, + {" 鈹傗攤 Caps 鈹 A 鈹 S 鈹 D 鈹 F 鈹 G 鈹 H 鈹 J 鈹 K 鈹 L 鈹 ;:鈹 \'\"鈹 Enter 鈹 鈹 4 鈹 5 鈹 6 鈹 鈹傗攤"}, + {" 鈹傗敎鈹鈹鈹鈹鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹敩鈹鈹鈹粹攢鈹鈹鈹鈹鈹鈹鈹 鈹屸攢鈹鈹鈹 鈹溾攢鈹鈹鈹尖攢鈹鈹鈹尖攢鈹鈹鈹尖攢鈹鈹鈹も攤"}, + {" 鈹傗攤 Shift 鈹 Z 鈹 X 鈹 C 鈹 V 鈹 B 鈹 N 鈹 M 鈹 ,<鈹 .>鈹 /?鈹 Shift 鈹 鈹 鈫戔攤 鈹 1 鈹 2 鈹 3 鈹 鈹傗攤鈹"}, + {" 鈹傗敎鈹鈹鈹鈹鈹攢鈹鈹粹攢鈹攢鈹粹攢鈹鈹敶鈹鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹敶鈹鈹鈹鈺攢鈹鈹鈹攢鈹鈹鈹鈹鈹鈹も攲鈹鈹鈹鈹尖攢鈹鈹鈹尖攢鈹鈹鈹愨敎鈹鈹鈹鈹粹攢鈹鈹鈹尖攢鈹鈹鈹 鈹傗攤鈹"}, + {" 鈹傗攤 Ctr鈹 win鈹 Alt鈹 鈹鈹鈹鈹 鈹 Alt鈹 Fn鈹 Ctrl 鈹傗攤鈫 鈹 鈫撯攤 鈫掆攤鈹 0ins 鈹.de鈹傗啇鈹樷攤鈹"}, + {" 鈹傗敂鈹鈹鈹鈹鈹粹攢鈹鈹鈹鈹粹攢鈹鈹鈹鈹粹攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹粹攢鈹鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹鈹鈹鈹樷敂鈹鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹樷敂鈹鈹鈹鈹鈹鈹鈹鈹粹攢鈹鈹鈹粹攢鈹鈹鈹樷攤"}, + {" 鈹 鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 鈹"}, + {" 鈹 鈹 鈹 鈹"}, + {" 鈹 鈹 鈹 鈹"}, + {" 鈹 鈹傗攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 鈹"}, + {" 鈹 鈹斺攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹粹攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹 鈹"}, + {" 鈹斺攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹"}}; +//鍔熻兘鏁扮粍 int keyboard[20][30] = { - //把键盘看成一个地图让move函数在上面移动返回的数值对应下面的 board_place[120][5]是对应按键的全部信息 + //鎶婇敭鐩樼湅鎴愪竴涓湴鍥捐move鍑芥暟鍦ㄤ笂闈㈢Щ鍔ㄨ繑鍥炵殑鏁板煎搴斾笅闈㈢殑 board_place[120][5]鏄搴旀寜閿殑鍏ㄩ儴淇℃伅 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 104, 104, 104, 104}, {0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37}, @@ -179,14 +179,14 @@ int keyboard[20][30] = { {0, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 86, 86, 0, 87, 0, 88, 89, 90, 91}, {0, 92, 93, 94, 95, 95, 95, 95, 95, 95, 95, 96, 97, 98, 98, 99, 100, 101, 102, 102, 103, 91}, }; -int next[9][2] = {{0}, {0}, {0}, {0}, {0}, {-1, 0}, {0, -1}, {1, 0}, {0, 1}}; //给键盘传给虚拟键盘的键盘控制虚拟电脑用 -int computer_map[3][8] = {{0, 0, 0, 0, 0}, {0, 1, 2, 3, 4}, {5, 0, 0, 0, 0}}; //对应的移动操作记录 +int next[9][2] = {{0}, {0}, {0}, {0}, {0}, {-1, 0}, {0, -1}, {1, 0}, {0, 1}}; //缁欓敭鐩樹紶缁欒櫄鎷熼敭鐩樼殑閿洏鎺у埗铏氭嫙鐢佃剳鐢 +int computer_map[3][8] = {{0, 0, 0, 0, 0}, {0, 1, 2, 3, 4}, {5, 0, 0, 0, 0}}; //瀵瑰簲鐨勭Щ鍔ㄦ搷浣滆褰 int computer_map_place[6][2] = {{0}, {2, 9}, {2, 19}, {2, 29}, {2, 40}, {6, 12}}; int cx , cy , tcx, tcy, lcx, lcy; -int board_place[120][5] = { //这是按键的信息 下标依次对应 -返回值 -按下shift下的返回值2 -键盘字符长度 -字符坐标x -y - {0, 0, 0, 0, 0}, //第一项如果是字符那么那就是返回字符 如果是数字1-9那么就是功能按键功能对应如下 +int board_place[120][5] = { //杩欐槸鎸夐敭鐨勪俊鎭 涓嬫爣渚濇瀵瑰簲 -杩斿洖鍊 -鎸変笅shift涓嬬殑杩斿洖鍊2 -閿洏瀛楃闀垮害 -瀛楃鍧愭爣x -y + {0, 0, 0, 0, 0}, //绗竴椤瑰鏋滄槸瀛楃閭d箞閭e氨鏄繑鍥炲瓧绗 濡傛灉鏄暟瀛1-9閭d箞灏辨槸鍔熻兘鎸夐敭鍔熻兘瀵瑰簲濡備笅 {1, 1, 3, 21, 19}, //1-10 - {0, 0, 2, 21, 28}, //1 ~ 返回 2 ~删除 3确认 4shift 5上 6左 7下 8又 9开机 + {0, 0, 2, 21, 28}, //1 ~ 杩斿洖 2 ~鍒犻櫎 3纭 4shift 5涓 6宸 7涓 8鍙 9寮鏈 {0, 0, 2, 21, 32}, {0, 0, 2, 21, 36}, {0, 0, 2, 21, 40}, @@ -290,25 +290,25 @@ int cx , cy , tcx, tcy, lcx, lcy; {'.', '.', 4, 32, 99}, {9, 9, 4, 18, 99}}; -// 程序功能变量 -int flag = 0, function, if_shift = 0, if_start = 0, if_input_password = 0, if_into_desktop = 0, if_game = 0; //0表示输入无效,1表示是输入电脑键 2表示是功能键, +// 绋嬪簭鍔熻兘鍙橀噺 +int flag = 0, function, if_shift = 0, if_start = 0, if_input_password = 0, if_into_desktop = 0, if_game = 0; //0琛ㄧず杈撳叆鏃犳晥锛1琛ㄧず鏄緭鍏ョ數鑴戦敭 2琛ㄧず鏄姛鑳介敭锛 char letter; int x, y, tx, ty, num, lx, ly; char temp[6] = {"====="}; char put_in_computer[20]; -char password_0[20] = {"WHJY"}; // 密码 +char password_0[20] = {"WHJY"}; // 瀵嗙爜 int put_in_num = 0, if_input = 0, input_x, input_y, input_max; -// 汉诺塔游戏变量 +// 姹夎濉旀父鎴忓彉閲 int mid_x = 7, mid_y = 60; int len, width, left, mid, right, time; int ttx = 10, tty = 10; char game_map[80][1000]; -int game_next[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; //上0下1左2右3; +int game_next[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; //涓0涓1宸2鍙3锛 -int turn[2][3] = {{0, 3, 1}, //a -> b b -> c a -> c 上右下 - {0, 2, 1}}; //b -> a c -> b c -> a 上左下 //实现自动移动的路线储存 +int turn[2][3] = {{0, 3, 1}, //a -> b b -> c a -> c 涓婂彸涓 + {0, 2, 1}}; //b -> a c -> b c -> a 涓婂乏涓 //瀹炵幇鑷姩绉诲姩鐨勮矾绾垮偍瀛 -void gotoxy(int x, int y) //坐标函数 +void gotoxy(int x, int y) //鍧愭爣鍑芥暟 { HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); COORD pos; @@ -317,7 +317,7 @@ char game_map[80][1000]; SetConsoleCursorPosition(handle, pos); } void init_game(int n) -{ //初始化汉诺塔 +{ //鍒濆鍖栨眽璇哄 int i, j; time = 50 / n; left = 1, mid = 2 * (n + 1), right = mid + 2 * n + 1; @@ -336,12 +336,12 @@ void init_game(int n) if (num && (i >= 1 && i <= width - 1) && j % 2 != 0 && j < mid) { game_map[i][j] = -95; - game_map[i][j + 1] = -10; //打印 ■ ■占2个字节可以拆开来 + game_map[i][j + 1] = -10; //鎵撳嵃 鈻 鈻犲崰2涓瓧鑺傚彲浠ユ媶寮鏉 num--; } } } - //容易出现东西卡顿 + //瀹规槗鍑虹幇涓滆タ鍗¢】 for (i = 0; i <= width; i++) { gotoxy(tty, ttx + i); @@ -352,14 +352,14 @@ void init_game(int n) } void play(int x, int y) -{ //显示汉诺塔移动轨迹 +{ //鏄剧ず姹夎濉旂Щ鍔ㄨ建杩 int turn_0, n = 0, i, j, k, tx, ty, flag = 0; if ((x == mid && y == right) || (x == left && y == mid) || (x == left && y == right)) - turn_0 = 0; //往右 + turn_0 = 0; //寰鍙 else if ((x == mid && y == left) || (x == right && y == left) || (x == right && y == mid)) - turn_0 = 1; //往左 + turn_0 = 1; //寰宸 for (i = 1, j = y; i <= width; i++) - { //目的地 + { //鐩殑鍦 if (game_map[i][j] != 0) { tx = i - 1; @@ -368,7 +368,7 @@ void play(int x, int y) } } for (i = 1, j = x; i <= width; i++) - { //出发点 + { //鍑哄彂鐐 if (game_map[i][j] != 0) { break; @@ -405,7 +405,7 @@ void play(int x, int y) printf("%c", game_map[i][j + k]); } } - n++; //改变方向; + n++; //鏀瑰彉鏂瑰悜; if (i == tx && j == ty) return; if (turn_0 == 0) @@ -436,7 +436,7 @@ void play(int x, int y) } void move_hnt(int a, int b, int c, char aa, char bb, char cc, int n) -{ //正常的汉诺塔递归程序 +{ //姝e父鐨勬眽璇哄閫掑綊绋嬪簭 if (n == 1) { //printf("from %c to %c",aa,cc); @@ -450,20 +450,20 @@ void move_hnt(int a, int b, int c, char aa, char bb, char cc, int n) move_hnt(b, a, c, bb, aa, cc, n - 1); } void init() -{ //初始化整个程序 +{ //鍒濆鍖栨暣涓▼搴 int i; tcx = computer_map_place[computer_map[cx][cy]][0]; tcy = computer_map_place[computer_map[cx][cy]][1]; lcx = cx, lcy = cy; cx = 1; cy = 1; - printf("↑ ↓ ← → 空格 进行操作\n\n"); - printf("用空格按下电源键即可进行开机\n\n"); - printf("xp系统祝你使用愉快~~\n\n"); - printf("开机密码WHJY\n"); - printf("桌面程序只有第一个和相关有用,其他暂未开放\n"); - printf("汉诺塔程序运行过程中是不能中止的,尽量开6个以下\n"); //这里是原本写了一个版本,自动变化函数+人工输入函数能中途退出,但改一下整个程序都要改动,就放弃了那个版本 - printf("按任意键继续\n"); + printf("鈫 鈫 鈫 鈫 绌烘牸 杩涜鎿嶄綔\n\n"); + printf("鐢ㄧ┖鏍兼寜涓嬬數婧愰敭鍗冲彲杩涜寮鏈篭n\n"); + printf("xp绯荤粺绁濅綘浣跨敤鎰夊揩~~\n\n"); + printf("寮鏈哄瘑鐮乄HJY\n"); + printf("妗岄潰绋嬪簭鍙湁绗竴涓拰鐩稿叧鏈夌敤锛屽叾浠栨殏鏈紑鏀綷n"); + printf("姹夎濉旂▼搴忚繍琛岃繃绋嬩腑鏄笉鑳戒腑姝㈢殑锛屽敖閲忓紑6涓互涓媆n"); //杩欓噷鏄師鏈啓浜嗕竴涓増鏈紝鑷姩鍙樺寲鍑芥暟+浜哄伐杈撳叆鍑芥暟鑳戒腑閫旈鍑猴紝浣嗘敼涓涓嬫暣涓▼搴忛兘瑕佹敼鍔紝灏辨斁寮冧簡閭d釜鐗堟湰 + printf("鎸変换鎰忛敭缁х画\n"); getch(); system("color 70"); system("mode con cols=125 lines=60"); @@ -483,7 +483,7 @@ void init() } } void init_start() -{ // 开机 + 动态加载页面 + 打开输入密码权限 +{ // 寮鏈 + 鍔ㄦ佸姞杞介〉闈 + 鎵撳紑杈撳叆瀵嗙爜鏉冮檺 int i,l, j; gotoxy(0, 0); @@ -493,7 +493,7 @@ void init_start() Sleep(100); } for (l = 0; l < 3; l++) - { //动态加载 + { //鍔ㄦ佸姞杞 for (i = 53; i <= 71; i = i + 2) { for (j = i - 4; j <= i; j = j + 2) @@ -521,13 +521,13 @@ void init_start() printf("%s\n", password[i]); Sleep(10); } - if_input = 1; // 9 77 18个 + if_input = 1; // 9 77 18涓 input_x = 9; input_y = 77; input_max = 18; } void load_desktop() -{ //加载桌面 +{ //鍔犺浇妗岄潰 int i; if_into_desktop = 1; if_input = 0; @@ -540,7 +540,7 @@ void load_desktop() } } void end() -{ //加载关机 (关机做的有点仓促) +{ //鍔犺浇鍏虫満 锛堝叧鏈哄仛鐨勬湁鐐逛粨淇冿級 int i; gotoxy(0, 0); for (i = 0; i <= 16; i++) @@ -556,7 +556,7 @@ void end() } } void load_more() -{ //更多信息 +{ //鏇村淇℃伅 int i; gotoxy(0, 0); for (i = 0; i <= 16; i++) @@ -566,7 +566,7 @@ void load_more() } } void load_game() -{ //加载汉诺塔程序 +{ //鍔犺浇姹夎濉旂▼搴 int i; if_into_desktop = 0; gotoxy(0, 0); @@ -578,14 +578,14 @@ void load_game() } if_game = 1; gotoxy(mid_y - 16, mid_x); - printf("请输入你要递归的汉诺塔数目_"); + printf("璇疯緭鍏ヤ綘瑕侀掑綊鐨勬眽璇哄鏁扮洰_"); input_x = mid_x; input_y = mid_y - 16 + 27; input_max = 1; if_input = 1; } int move() -{ //控制虚拟键盘的指针移动函数 +{ //鎺у埗铏氭嫙閿洏鐨勬寚閽堢Щ鍔ㄥ嚱鏁 int i; char ch = '\0', ch1 = '\0'; while (ch != ' ') @@ -596,7 +596,7 @@ int move() ch != -32) continue; if (ch == -32) - { //同时启用wasd 和上下左右键 //如果读取到第一个是-32那么 继续读取一个字符 + { //鍚屾椂鍚敤wasd 鍜屼笂涓嬪乏鍙抽敭 //濡傛灉璇诲彇鍒扮涓涓槸-32閭d箞 缁х画璇诲彇涓涓瓧绗 ch1 = getch(); switch (ch1) { @@ -669,7 +669,7 @@ int move() } } void put_letter_to_computer(char letter) -{ //把字符传输给电脑屏幕,如果电脑if_input为零就禁止显示 +{ //鎶婂瓧绗︿紶杈撶粰鐢佃剳灞忓箷锛屽鏋滅數鑴慽f_input涓洪浂灏辩姝㈡樉绀 if (if_input == 1 && put_in_num < input_max) { put_in_computer[put_in_num] = letter; @@ -680,9 +680,9 @@ void put_letter_to_computer(char letter) printf("%s", put_in_computer); } void put_function_to_computer(int function) -{ //电脑处理相应共呢 1 ~ 返回 2 ~删除 3确认 4shift 5上 6左 7下 8又 9开机 +{ //鐢佃剳澶勭悊鐩稿簲鍏卞憿 1 ~ 杩斿洖 2 ~鍒犻櫎 3纭 4shift 5涓 6宸 7涓 8鍙 9寮鏈 if (function == 9) - { //开机 + { //寮鏈 if (if_start == 0) { init_start(); @@ -696,7 +696,7 @@ void put_function_to_computer(int function) } } if (function == 2 && put_in_num > 0 && if_input == 1) - { //删除字符,但不可越界 + { //鍒犻櫎瀛楃锛屼絾涓嶅彲瓒婄晫 put_in_num--; put_in_computer[put_in_num] = '\0'; gotoxy(input_y, input_x); @@ -704,14 +704,14 @@ void put_function_to_computer(int function) printf(" "); } if (function == 4) - { //切换大小写 + { //鍒囨崲澶у皬鍐 if (if_shift) if_shift = 0; else if_shift = 1; } if (function == 3 && if_input == 1 && if_game == 0) - { //确认对应不同模式下的不同功能 + { //纭瀵瑰簲涓嶅悓妯″紡涓嬬殑涓嶅悓鍔熻兘 if (strcmp(password_0, put_in_computer) == 0) { load_desktop(); @@ -724,7 +724,7 @@ void put_function_to_computer(int function) put_in_num = 0; put_in_computer[put_in_num] = '\0'; gotoxy(input_y, input_x); - printf("密 码 错 误 !!!"); + printf("瀵 鐮 閿 璇 锛侊紒锛"); gotoxy(input_y, input_x); Sleep(1200); printf(" "); @@ -769,7 +769,7 @@ void put_function_to_computer(int function) load_desktop(); } } - //if(if_game == 1 && function >= 5 && function <= 8)) 移动类型游戏暂未开放 + //if(if_game == 1 && function >= 5 && function <= 8)) 绉诲姩绫诲瀷娓告垙鏆傛湭寮鏀 if (if_into_desktop && function >= 5 && function <= 8) { int ncx = cx + next[function][0], ncy = cy + next[function][1]; @@ -786,7 +786,7 @@ void put_function_to_computer(int function) } } if (function == 1 && if_into_desktop) - { //返回 + { //杩斿洖 load_desktop(); } } @@ -794,22 +794,22 @@ void put_function_to_computer(int function) int main() { init(); - /*load_desktop();//直接进入桌面 + /*load_desktop();//鐩存帴杩涘叆妗岄潰 if_start = 1; if_into_desktop = 1;*/ while (1) - { //主循环 - flag = move(); //move提取读取的键盘按键并判断类型 + { //涓诲惊鐜 + flag = move(); //move鎻愬彇璇诲彇鐨勯敭鐩樻寜閿苟鍒ゆ柇绫诲瀷 switch (flag) { case 0: - break; //暂无效果的按键 + break; //鏆傛棤鏁堟灉鐨勬寜閿 case 1: put_letter_to_computer(letter); - break; //返回字符型按键给电脑 + break; //杩斿洖瀛楃鍨嬫寜閿粰鐢佃剳 case 2: put_function_to_computer(function); - break; //返回功能型按键给电脑 + break; //杩斿洖鍔熻兘鍨嬫寜閿粰鐢佃剳 } } getchar(); diff --git "a/\346\265\213\350\257\225\346\226\207\344\273\266\345\244\271/helloworld.cpp" "b/\346\265\213\350\257\225\346\226\207\344\273\266\345\244\271/helloworld.cpp" new file mode 100644 index 0000000..eedcbce --- /dev/null +++ "b/\346\265\213\350\257\225\346\226\207\344\273\266\345\244\271/helloworld.cpp" @@ -0,0 +1,7 @@ +#include +using namespace std; + +int main(){ + cout << "hello world" << endl; + return 0; +} \ No newline at end of file diff --git "a/\346\274\202\346\265\201\347\223\266/\347\272\257C\350\257\255\350\250\200\347\211\210/\346\274\202\346\265\201\347\223\266(\347\273\223\346\236\204\344\275\223\347\211\210).c" "b/\346\274\202\346\265\201\347\223\266/\347\272\257C\350\257\255\350\250\200\347\211\210/\346\274\202\346\265\201\347\223\266(\347\273\223\346\236\204\344\275\223\347\211\210).c" index f7c9d12..fee7828 100644 --- "a/\346\274\202\346\265\201\347\223\266/\347\272\257C\350\257\255\350\250\200\347\211\210/\346\274\202\346\265\201\347\223\266(\347\273\223\346\236\204\344\275\223\347\211\210).c" +++ "b/\346\274\202\346\265\201\347\223\266/\347\272\257C\350\257\255\350\250\200\347\211\210/\346\274\202\346\265\201\347\223\266(\347\273\223\346\236\204\344\275\223\347\211\210).c" @@ -1,33 +1,33 @@ /*-------------------------------------------------------------------- -程序: C语言 漂流瓶 -作者: 404name | 绝伦N -说明: 功能预览版 | 可自定义数据 -自定义方法: - ·增添数据: - 往结构体18行结构体后面添加相同规格数据即可 - 之后系统会自动汇总数据处理页面,并进行分页。 - 无需进行更多操作 - ·更改界面: - 自己读懂逻辑后更改相对应的属性即可 - ·属性介绍: - User 仅限10个以内字符(5个汉字/10英文字符) - Datetime 2020-03-05 04:11:12日期的长度 - 并且C语言版本不支持自动设置时间 - 有能力可以自己调用函数试试 - Message 108个汉字的文字内容,超出范围系统会默认在后面打上省略号 -版本及时间: ver 1.0.0 2020-06-10 20:20:12 +绋嬪簭锛 C璇█ 婕傛祦鐡 +浣滆咃細 404name | 缁濅鸡N +璇存槑: 鍔熻兘棰勮鐗 | 鍙嚜瀹氫箟鏁版嵁 +鑷畾涔夋柟娉曪細 + 路澧炴坊鏁版嵁锛 + 寰缁撴瀯浣18琛岀粨鏋勪綋鍚庨潰娣诲姞鐩稿悓瑙勬牸鏁版嵁鍗冲彲 + 涔嬪悗绯荤粺浼氳嚜鍔ㄦ眹鎬绘暟鎹鐞嗛〉闈紝骞惰繘琛屽垎椤点 + 鏃犻渶杩涜鏇村鎿嶄綔 + 路鏇存敼鐣岄潰锛 + 鑷繁璇绘噦閫昏緫鍚庢洿鏀圭浉瀵瑰簲鐨勫睘鎬у嵆鍙 + 路灞炴т粙缁嶏細 + User 浠呴檺10涓互鍐呭瓧绗(5涓眽瀛/10鑻辨枃瀛楃) + Datetime 2020-03-05 04:11:12鏃ユ湡鐨勯暱搴 + 骞朵笖C璇█鐗堟湰涓嶆敮鎸佽嚜鍔ㄨ缃椂闂 + 鏈夎兘鍔涘彲浠ヨ嚜宸辫皟鐢ㄥ嚱鏁拌瘯璇 + Message 108涓眽瀛楃殑鏂囧瓧鍐呭锛岃秴鍑鸿寖鍥寸郴缁熶細榛樿鍦ㄥ悗闈㈡墦涓婄渷鐣ュ彿 +鐗堟湰鍙婃椂闂达細 ver 1.0.0 2020-06-10 20:20:12 --------------------------------------------------------------------*/ -#include //用于getch() +#include //鐢ㄤ簬getch锛堬級 #include -#include //用于rand +#include //鐢ㄤ簬rand #include #include #define width 64 #define height 22 #define page_include 6 -const char block1[3] = "█"; -const char block2[3] = "▓"; -const char point[4][3] = {{"/"}, {"¤"}, {" "}, {" "}}; +const char block1[3] = "鈻"; +const char block2[3] = "鈻"; +const char point[4][3] = {{"/"}, {"陇"}, {" "}, {" "}}; struct bottle { @@ -35,44 +35,44 @@ struct bottle char Datetime[30]; char Message[500]; } bottles[200] = { - {"讨厌这世界", "2020-06-08 17:39:43", "活着,就是选择一种死去的旅途。"}, - {"镜心女神", "2020-05-31 02:32:56", "今年15了,还是有很多事达不到。不会聊天、不会道歉、不够勇敢、不够努力、还是那样自卑"}, - {"嗨皮农夫", "2020-05-20 19:53:16", "我想学好英语,我想出去看一看,我想去看看国外是不是真的有大教堂?那有多大?国外是不是真的有那么美的大草原?国外是不是真的像电影那样?都是一个一个静谧的小镇,所以加油,希望七八年后的我会在国外发一张帖子,在树洞网!加油!为了自己的愿望,为了那么美的风景,为了我喜欢的外国影视及明星(奥黛丽-赫本与凯特-温斯莱特)!"}, - {"虞姬", "2020-05-06 01:32:07", "因为想忘记他,所以找了个替代品,但终究只是替代品,没有可比性,算是精神上的寄托和慰籍,爱而不得,真的很无奈也很煎熬!…"}, - {"嫦娥", "2020-04-13 14:26:05", "自愈是一件很困难的事…"}, - {"嫦娥", "2020-04-13 14:27:05", "我喜欢你…"}, - {"花花好好的", "2020-04-14 15:24:05", "希望大家都能好好的或者,毕竟这个世界很美好!抱着沙发 睡眼昏花 凌乱头发渴望像电影主角一样潇洒"}, + {"璁ㄥ帉杩欎笘鐣", "2020-06-08 17:39:43", "娲荤潃锛屽氨鏄夋嫨涓绉嶆鍘荤殑鏃呴斻"}, + {"闀滃績濂崇", "2020-05-31 02:32:56", "浠婂勾15浜嗭紝杩樻槸鏈夊緢澶氫簨杈句笉鍒般備笉浼氳亰澶┿佷笉浼氶亾姝夈佷笉澶熷媷鏁€佷笉澶熷姫鍔涖佽繕鏄偅鏍疯嚜鍗"}, + {"鍡ㄧ毊鍐滃か", "2020-05-20 19:53:16", "鎴戞兂瀛﹀ソ鑻辫锛屾垜鎯冲嚭鍘荤湅涓鐪嬶紝鎴戞兂鍘荤湅鐪嬪浗澶栨槸涓嶆槸鐪熺殑鏈夊ぇ鏁欏爞锛熼偅鏈夊澶э紵鍥藉鏄笉鏄湡鐨勬湁閭d箞缇庣殑澶ц崏鍘燂紵鍥藉鏄笉鏄湡鐨勫儚鐢靛奖閭f牱锛熼兘鏄竴涓竴涓潤璋х殑灏忛晣锛屾墍浠ュ姞娌癸紝甯屾湜涓冨叓骞村悗鐨勬垜浼氬湪鍥藉鍙戜竴寮犲笘瀛愶紝鍦ㄦ爲娲炵綉锛佸姞娌癸紒涓轰簡鑷繁鐨勬効鏈涳紝涓轰簡閭d箞缇庣殑椋庢櫙锛屼负浜嗘垜鍠滄鐨勫鍥藉奖瑙嗗強鏄庢槦锛堝ゥ榛涗附-璧湰涓庡嚡鐗-娓╂柉鑾辩壒锛夛紒"}, + {"铏炲К", "2020-05-06 01:32:07", "鍥犱负鎯冲繕璁颁粬锛屾墍浠ユ壘浜嗕釜鏇夸唬鍝侊紝浣嗙粓绌跺彧鏄浛浠e搧锛屾病鏈夊彲姣旀э紝绠楁槸绮剧涓婄殑瀵勬墭鍜屾叞绫嶏紝鐖辫屼笉寰楋紝鐪熺殑寰堟棤濂堜篃寰堢厧鐔紒鈥"}, + {"瀚﹀ē", "2020-04-13 14:26:05", "鑷剤鏄竴浠跺緢鍥伴毦鐨勪簨鈥"}, + {"瀚﹀ē", "2020-04-13 14:27:05", "鎴戝枩娆綘鈥"}, + {"鑺辫姳濂藉ソ鐨", "2020-04-14 15:24:05", "甯屾湜澶у閮借兘濂藉ソ鐨勬垨鑰咃紝姣曠珶杩欎釜涓栫晫寰堢編濂斤紒鎶辩潃娌欏彂 鐫$溂鏄忚姳 鍑屼贡澶村彂娓存湜鍍忕數褰变富瑙掍竴鏍锋絿娲"}, {"88888", "2020-04-15 14:27:05", "2020-04-15 14:27:05"}, - {"10086", "2020-05-15 12:27:05", "尊敬的客户,您好,5月账单已经出来了,请及时缴费喔"}, - {"电竞食堂", "2020-02-15 15:27:03", "每一张卡牌,都是对你的一份思念,我赌赢了所有,却赢不回你的爱"}, - {"刀锋意志", "2020-03-15 14:27:05", "均衡存乎万物之间。 我的剑刃愿为你效劳。 "}, - {"思念", "2020-02-25 02:24:25", "啊……夜空绽放的烟花 点燃每一个盛夏 总让我莫名伤感 时光像风儿一样 悄悄地消失流淌 晨光映彩霞 夕阳茜风中 你牵着我 走在熟悉的街旁 直到尽头 依依不舍地紧紧相拥 与你在这最后的夏天 抹不去的思念 斜阳里的微笑 渐行渐远 六月的微风吹散你的泪光 深深地铭刻心间 难以忘却 与你许下这最后诺言微笑着离 "}, - {"我好想你", "2020-01-03 05:21:05", "在秒速5厘米间,他们发现了彼此。也在秒速5厘米之间,他们错过了彼此。"}, - {"111dw11", "2020-03-05 04:11:12", "希望在明年"}, - {"树洞先生", "2020-06-09 23:51:12", "作为一个山东人,我特别讨厌山东的官僚作风。大学毕业坚决不回山东。农民掏钱才能买的起质量不高的楼房,与民争利。自小接触的基层干部,干实事的少。山东,现在可能在我内心就是出生地了吧,没有多少意义,可能以后也很少回去了。带着家人好好的在别处生活吧。 "}, - {"时光", "2020-06-09 20:02:25", "人间烟火是什么的呢? 市集、小巷、美食.....香喷喷的烧烤,麻辣烫,凉皮凉面,卤味"}, - {"14449", "2020-06-08 16:00:11", "我想好好地活下去,因为我现在过得不好,所以我想活下去,我想把生活过得好一点,只是一点就好。 "}, - {"小先生", "2020-06-08 14:05:21", "也许,这就是人生吧"}, - {"一位朋友", "2012-01-22 23:41:48", "开开心心的吃完年夜饭 回家因为一个亲戚的拜年电话 家里吵了起来 一个人站在阳台上边看烟花边掉泪 冷到不行 最后被爸硬拉回房 到现在还不停的颤 想说 2012这样的日子 能不能一天都不要过 "}, - {"新浪匿名", "2012-01-22 22:21:45", "尼玛的补课喜欢上一个男的,靠,重点是他妹的我也是男的好嘛。看到他露出来的脚踝我要疯了好么。性格也很好,和老师开玩笑来着。声音也很好听。身高什么的更无话可说啊。烦死了。 "}, - {"????", "2015-03-25 22:20:15", "什么叫快乐?就是掩饰自己的悲伤对每个人微笑"}, - {"匿名网友", "2010-04-21 21:21:10", "你是gg还是mm啊"}, - {"卢本伟", "2019-02-15 20:05:05", "我!卢本伟!没有开挂!"}, - {"绝伦N", "2020-06-10 18:57:21", "啊,爬数据累坏了,早点爬完数据呀~~~"}, - {"漂流瓶", "2017-02-15 14:05:05", "感谢你收到了这个漂流瓶,现在大部分人都忘记了漂流瓶了,而屏幕前的你还在看着这个捞上来的消息,非常感谢你...希望这个漂流瓶能承载着过去的岁月一直漂流吧"}, - {"小迷妹", "2018-01-10 12:04:05", "我真的喜欢你,但我知道我配不上,看着你远去我又好心酸,真的,,真的。。。。。。。。。。。。。。。"}, - {"高考加油", "2020-06-08 14:50:21", "我要去你的大学和你相遇!!!!!!"}, - {"时光", "2017-05-07 12:35:21", "谁又记得曾经的我们呢,是这个漂流瓶?笑话,曾经的我们早就不在了!要谁去纪念呢?"}, - {"Java", "2018-06-05 13:25:51", "我是世界上最好的语言!"}, - {"awsl", "2019-06-08 21:25:51", "时间不会把我们冲淡,但距离会"}, - {"西瓜", "2017-11-18 01:25:05", "我看着你远去,不明白为什么你要去那遥远的未来呢?"}, - {"沙比", "2014-10-24 12:24:05", "我是sb,我是sb,我是sb,,我是sb,我是sb,我是sb,我是sb,我是sb,我是sb,我是sb,我是sb,我是sb,我是sb,"}, - {"锤子", "2020-05-01 15:20:51", "啊啊啊啊,我受不了了,辣鸡网课,学不下去了"}, - {"比利比利", "2020-06-10 14:22:20", "干杯"}, - {"啊啊啊啊", "2020-06-01 12:00:21", "儿童节快乐呀"}, -}; //往后追加数据即可 + {"10086", "2020-05-15 12:27:05", "灏婃暚鐨勫鎴凤紝鎮ㄥソ,5鏈堣处鍗曞凡缁忓嚭鏉ヤ簡,璇峰強鏃剁即璐瑰枖"}, + {"鐢电珵椋熷爞", "2020-02-15 15:27:03", "姣忎竴寮犲崱鐗岋紝閮芥槸瀵逛綘鐨勪竴浠芥濆康锛屾垜璧岃耽浜嗘墍鏈夛紝鍗磋耽涓嶅洖浣犵殑鐖"}, + {"鍒閿嬫剰蹇", "2020-03-15 14:27:05", "鍧囪 瀛樹箮涓囩墿涔嬮棿銆 鎴戠殑鍓戝垉鎰夸负浣犳晥鍔炽 "}, + {"鎬濆康", "2020-02-25 02:24:25", "鍟娾︹﹀绌虹唤鏀剧殑鐑熻姳 鐐圭噧姣忎竴涓洓澶 鎬昏鎴戣帿鍚嶄激鎰 鏃跺厜鍍忛鍎夸竴鏍 鎮勬倓鍦版秷澶辨祦娣 鏅ㄥ厜鏄犲僵闇 澶曢槼鑼滈涓 浣犵壍鐫鎴 璧板湪鐔熸倝鐨勮鏃 鐩村埌灏藉ご 渚濅緷涓嶈垗鍦扮揣绱х浉鎷 涓庝綘鍦ㄨ繖鏈鍚庣殑澶忓ぉ 鎶逛笉鍘荤殑鎬濆康 鏂滈槼閲岀殑寰瑧 娓愯娓愯繙 鍏湀鐨勫井椋庡惞鏁d綘鐨勬唱鍏 娣辨繁鍦伴摥鍒诲績闂 闅句互蹇樺嵈 涓庝綘璁镐笅杩欐渶鍚庤瑷寰瑧鐫绂 "}, + {"鎴戝ソ鎯充綘", "2020-01-03 05:21:05", "鍦ㄧ閫5鍘樼背闂达紝浠栦滑鍙戠幇浜嗗郊姝ゃ備篃鍦ㄧ閫5鍘樼背涔嬮棿锛屼粬浠敊杩囦簡褰兼銆"}, + {"111dw11", "2020-03-05 04:11:12", "甯屾湜鍦ㄦ槑骞"}, + {"鏍戞礊鍏堢敓", "2020-06-09 23:51:12", "浣滀负涓涓北涓滀汉锛屾垜鐗瑰埆璁ㄥ帉灞变笢鐨勫畼鍍氫綔椋庛傚ぇ瀛︽瘯涓氬潥鍐充笉鍥炲北涓溿傚啘姘戞帍閽辨墠鑳戒拱鐨勮捣璐ㄩ噺涓嶉珮鐨勬ゼ鎴匡紝涓庢皯浜夊埄銆傝嚜灏忔帴瑙︾殑鍩哄眰骞查儴锛屽共瀹炰簨鐨勫皯銆傚北涓滐紝鐜板湪鍙兘鍦ㄦ垜鍐呭績灏辨槸鍑虹敓鍦颁簡鍚э紝娌℃湁澶氬皯鎰忎箟锛屽彲鑳戒互鍚庝篃寰堝皯鍥炲幓浜嗐傚甫鐫瀹朵汉濂藉ソ鐨勫湪鍒鐢熸椿鍚с "}, + {"鏃跺厜", "2020-06-09 20:02:25", "浜洪棿鐑熺伀鏄粈涔堢殑鍛紵 甯傞泦銆佸皬宸枫佺編椋.....棣欏柗鍠风殑鐑х儰锛岄夯杈g儷锛屽噳鐨噳闈紝鍗ゅ懗"}, + {"14449", "2020-06-08 16:00:11", "鎴戞兂濂藉ソ鍦版椿涓嬪幓锛屽洜涓烘垜鐜板湪杩囧緱涓嶅ソ锛屾墍浠ユ垜鎯虫椿涓嬪幓锛屾垜鎯虫妸鐢熸椿杩囧緱濂戒竴鐐癸紝鍙槸涓鐐瑰氨濂姐 "}, + {"灏忓厛鐢", "2020-06-08 14:05:21", "涔熻锛岃繖灏辨槸浜虹敓鍚"}, + {"涓浣嶆湅鍙", "2012-01-22 23:41:48", "寮寮蹇冨績鐨勫悆瀹屽勾澶滈キ 鍥炲鍥犱负涓涓翰鎴氱殑鎷滃勾鐢佃瘽 瀹堕噷鍚典簡璧锋潵 涓涓汉绔欏湪闃冲彴涓婅竟鐪嬬儫鑺辫竟鎺夋唱 鍐峰埌涓嶈 鏈鍚庤鐖哥‖鎷夊洖鎴 鍒扮幇鍦ㄨ繕涓嶅仠鐨勯ⅳ 鎯宠 2012杩欐牱鐨勬棩瀛 鑳戒笉鑳戒竴澶╅兘涓嶈杩 "}, + {"鏂版氮鍖垮悕", "2012-01-22 22:21:45", "灏肩帥鐨勮ˉ璇惧枩娆笂涓涓敺鐨勶紝闈狅紝閲嶇偣鏄粬濡圭殑鎴戜篃鏄敺鐨勫ソ鍢涖傜湅鍒颁粬闇插嚭鏉ョ殑鑴氳笣鎴戣鐤簡濂戒箞銆傛ф牸涔熷緢濂斤紝鍜岃佸笀寮鐜╃瑧鏉ョ潃銆傚0闊充篃寰堝ソ鍚傝韩楂樹粈涔堢殑鏇存棤璇濆彲璇村晩銆傜儲姝讳簡銆 "}, + {"????", "2015-03-25 22:20:15", "浠涔堝彨蹇箰?灏辨槸鎺╅グ鑷繁鐨勬偛浼ゅ姣忎釜浜哄井绗"}, + {"鍖垮悕缃戝弸", "2010-04-21 21:21:10", "浣犳槸gg杩樻槸mm鍟"}, + {"鍗㈡湰浼", "2019-02-15 20:05:05", "鎴戯紒鍗㈡湰浼燂紒娌℃湁寮鎸!"}, + {"缁濅鸡N", "2020-06-10 18:57:21", "鍟婏紝鐖暟鎹疮鍧忎簡锛屾棭鐐圭埇瀹屾暟鎹憖~~~"}, + {"婕傛祦鐡", "2017-02-15 14:05:05", "鎰熻阿浣犳敹鍒颁簡杩欎釜婕傛祦鐡讹紝鐜板湪澶ч儴鍒嗕汉閮藉繕璁颁簡婕傛祦鐡朵簡锛岃屽睆骞曞墠鐨勪綘杩樺湪鐪嬬潃杩欎釜鎹炰笂鏉ョ殑娑堟伅锛岄潪甯告劅璋綘...甯屾湜杩欎釜婕傛祦鐡惰兘鎵胯浇鐫杩囧幓鐨勫瞾鏈堜竴鐩存紓娴佸惂"}, + {"灏忚糠濡", "2018-01-10 12:04:05", "鎴戠湡鐨勫枩娆綘锛屼絾鎴戠煡閬撴垜閰嶄笉涓婏紝鐪嬬潃浣犺繙鍘绘垜鍙堝ソ蹇冮吀锛岀湡鐨勶紝锛岀湡鐨勩傘傘傘傘傘傘傘傘傘傘傘傘傘傘"}, + {"楂樿冨姞娌", "2020-06-08 14:50:21", "鎴戣鍘讳綘鐨勫ぇ瀛﹀拰浣犵浉閬囷紒锛侊紒锛侊紒锛"}, + {"鏃跺厜", "2017-05-07 12:35:21", "璋佸張璁板緱鏇剧粡鐨勬垜浠憿锛屾槸杩欎釜婕傛祦鐡讹紵绗戣瘽锛屾浘缁忕殑鎴戜滑鏃╁氨涓嶅湪浜嗭紒瑕佽皝鍘荤邯蹇靛憿锛"}, + {"Java", "2018-06-05 13:25:51", "鎴戞槸涓栫晫涓婃渶濂界殑璇█锛"}, + {"awsl", "2019-06-08 21:25:51", "鏃堕棿涓嶄細鎶婃垜浠啿娣★紝浣嗚窛绂讳細"}, + {"瑗跨摐", "2017-11-18 01:25:05", "鎴戠湅鐫浣犺繙鍘伙紝涓嶆槑鐧戒负浠涔堜綘瑕佸幓閭i仴杩滅殑鏈潵鍛紵"}, + {"娌欐瘮", "2014-10-24 12:24:05", "鎴戞槸sb锛屾垜鏄痵b锛屾垜鏄痵b锛岋紝鎴戞槸sb锛屾垜鏄痵b锛屾垜鏄痵b锛屾垜鏄痵b锛屾垜鏄痵b锛屾垜鏄痵b锛屾垜鏄痵b锛屾垜鏄痵b锛屾垜鏄痵b锛屾垜鏄痵b锛"}, + {"閿ゅ瓙", "2020-05-01 15:20:51", "鍟婂晩鍟婂晩锛屾垜鍙椾笉浜嗕簡锛岃荆楦$綉璇撅紝瀛︿笉涓嬪幓浜"}, + {"姣斿埄姣斿埄", "2020-06-10 14:22:20", "骞叉澂"}, + {"鍟婂晩鍟婂晩", "2020-06-01 12:00:21", "鍎跨鑺傚揩涔愬憖"}, +}; //寰鍚庤拷鍔犳暟鎹嵆鍙 -char keymap[10][7] = { //对应光标去去处 +char keymap[10][7] = { //瀵瑰簲鍏夋爣鍘诲幓澶 {"xxxxxx"}, {"x0000x"}, {"x1111x"}, @@ -82,7 +82,7 @@ struct bottle {"x5555x"}, {"x6789x"}, {"xxxxxx"}}; -int keymap_to_map0[10][2] = { //keymap映射路劲 +3对应输出文字的地方 +int keymap_to_map0[10][2] = { //keymap鏄犲皠璺姴 +3瀵瑰簲杈撳嚭鏂囧瓧鐨勫湴鏂 {14, 5}, //0 {14, 7}, {14, 9}, //2 @@ -95,40 +95,40 @@ struct bottle {47, 19}}; int tx, ty, now_x, now_y, function, point_flag; int page, All_messages, All_pages; -int menu_flag; // 0加载动画, 1主菜单 2留言面板 3留言面板查看信息 返回键依次回溯 -const char mapMaker[8][3] = { //界面采用逻辑构建这里是材料 也能复制界面用数组存着打印 +int menu_flag; // 0鍔犺浇鍔ㄧ敾锛 1涓昏彍鍗 2鐣欒█闈㈡澘 3鐣欒█闈㈡澘鏌ョ湅淇℃伅 杩斿洖閿緷娆″洖婧 +const char mapMaker[8][3] = { //鐣岄潰閲囩敤閫昏緫鏋勫缓杩欓噷鏄潗鏂 涔熻兘澶嶅埗鐣岄潰鐢ㄦ暟缁勫瓨鐫鎵撳嵃 {"/"}, //0 - {"▔"}, //1 - {"▏"}, //2 - {"█"}, //3 + {"鈻"}, //1 + {"鈻"}, //2 + {"鈻"}, //3 {"\\"}, //4 - {"▁"}}; //5 -const char title[10][50] = { //偶数主菜单,奇数附页面 - {"|信息|User: Datetime: "}, - {"|瓶子|404name Datetime: "}, - {" 这是首页喔~ 欢迎你的使用 "}, + {"鈻"}}; //5 +const char title[10][50] = { //鍋舵暟涓昏彍鍗曪紝濂囨暟闄勯〉闈 + {"|淇℃伅|User: Datetime: "}, + {"|鐡跺瓙|404name Datetime: "}, + {" 杩欐槸棣栭〉鍠攡 娆㈣繋浣犵殑浣跨敤 "}, {" "}, - {" 漂流瓶 ver 1.0.0 "}, + {" 婕傛祦鐡 ver 1.0.0 "}, {" "}, - {" 采用C语言搭建 "}, + {" 閲囩敤C璇█鎼缓 "}, {" "}, - {" 欢迎你的使用 "}}; -const char menu[8][12] = { //偶数主菜单,奇数附页面 - {"Θ===="}, - {"Θ返回"}, - {"¤扔一个"}, - {"←上一页"}, - {"◎捞捞看"}, - {"→下一页"}, - {"⊕我的瓶子"}, - {"⊕页码:01"}}; -void HideCursor(int x) //光标隐藏 + {" 娆㈣繋浣犵殑浣跨敤 "}}; +const char menu[8][12] = { //鍋舵暟涓昏彍鍗曪紝濂囨暟闄勯〉闈 + {"螛===="}, + {"螛杩斿洖"}, + {"陇鎵斾竴涓"}, + {"鈫愪笂涓椤"}, + {"鈼庢崬鎹炵湅"}, + {"鈫掍笅涓椤"}, + {"鈯曟垜鐨勭摱瀛"}, + {"鈯曢〉鐮侊細01"}}; +void HideCursor(int x) //鍏夋爣闅愯棌 { - CONSOLE_CURSOR_INFO cursor_info = {1, x}; //后边的0代表光标不可见 + CONSOLE_CURSOR_INFO cursor_info = {1, x}; //鍚庤竟鐨0浠h〃鍏夋爣涓嶅彲瑙 SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info); } -void gotoxy(int x, int y) //坐标函数 +void gotoxy(int x, int y) //鍧愭爣鍑芥暟 { HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); COORD pos; @@ -137,7 +137,7 @@ int page, All_messages, All_pages; SetConsoleCursorPosition(handle, pos); } -void change_menu(int turn) //更改菜单的功能按钮显示 进入不同页面显示不同功能 +void change_menu(int turn) //鏇存敼鑿滃崟鐨勫姛鑳芥寜閽樉绀 杩涘叆涓嶅悓椤甸潰鏄剧ず涓嶅悓鍔熻兘 { int flag = 0, i; if (turn == 1) @@ -170,9 +170,9 @@ int page, All_messages, All_pages; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10 | 1); } -void init() //总init +void init() //鎬籭nit { - //初始化消息数目与页数处理 + //鍒濆鍖栨秷鎭暟鐩笌椤垫暟澶勭悊 int i, j; for (i = 0;; i++) { @@ -182,13 +182,13 @@ int page, All_messages, All_pages; All_messages = i; page = 0; All_pages = (All_messages % page_include == 0 ? All_messages / page_include : All_messages / page_include + 1); - //处理光标显示 + //澶勭悊鍏夋爣鏄剧ず HideCursor(0); - point_flag = 0; //光标形态 + point_flag = 0; //鍏夋爣褰㈡ now_x = 7, now_y = 1; - //HideCursor(); //隐藏光标 + //HideCursor(); //闅愯棌鍏夋爣 menu_flag = 1; - //逻辑构建地图 也可以复制下来存字符串去打印但需要先for后面打个断点再复制页面 + //閫昏緫鏋勫缓鍦板浘 涔熷彲浠ュ鍒朵笅鏉ュ瓨瀛楃涓插幓鎵撳嵃浣嗛渶瑕佸厛for鍚庨潰鎵撲釜鏂偣鍐嶅鍒堕〉闈 for (i = 0; i < height; i++) { for (j = 0; j <= width; j++) @@ -235,13 +235,13 @@ int page, All_messages, All_pages; Sleep(50); } gotoxy(4, height - 3); - printf(" ▔▔ ▔▔▔ ▔▔▔ ▔▔▔▔ "); - //构建地图结束点 + printf(" 鈻斺枖 鈻斺枖鈻 鈻斺枖鈻 鈻斺枖鈻斺枖 "); + //鏋勫缓鍦板浘缁撴潫鐐 - //显示初始的界面选项3功能 + //鏄剧ず鍒濆鐨勭晫闈㈤夐」3鍔熻兘 change_menu(menu_flag); - //定位初始光标指针 + //瀹氫綅鍒濆鍏夋爣鎸囬拡 function = keymap[now_x][now_y] - '0'; tx = keymap_to_map0[function][0]; ty = keymap_to_map0[function][1]; @@ -252,7 +252,7 @@ int page, All_messages, All_pages; int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, int xx, int yy) { - //参数:开始坐标x y 限制活动空间 x左右 y上下 移动距离 x y + //鍙傛暟锛氬紑濮嬪潗鏍噚 y 闄愬埗娲诲姩绌洪棿 x宸﹀彸 y涓婁笅 绉诲姩璺濈 x y SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10 | 0); int last_x = x, last_y = y; function = keymap[x][y] - '0'; @@ -268,9 +268,9 @@ int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, i { ch = getch(); gotoxy(tx, ty); - printf("%s", point[point_flag + 2]); //输出空格消除 + printf("%s", point[point_flag + 2]); //杈撳嚭绌烘牸娑堥櫎 if (ch == -32) - { //同时启用wasd 和上下左右键 //如果读取到第一个是-32那么 继续读取一个字符 + { //鍚屾椂鍚敤wasd 鍜屼笂涓嬪乏鍙抽敭 //濡傛灉璇诲彇鍒扮涓涓槸-32閭d箞 缁х画璇诲彇涓涓瓧绗 ch1 = getch(); switch (ch1) { @@ -311,9 +311,9 @@ int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, i y = last_y; } last_y = y, last_x = x; - if (x == 7) //在x == 7的时候光标显示 == / + if (x == 7) //鍦▁ == 7鐨勬椂鍊欏厜鏍囨樉绀 == / point_flag = 0; - else // 不然在x < 7的时候光标变成 O + else // 涓嶇劧鍦▁ < 7鐨勬椂鍊欏厜鏍囧彉鎴 O point_flag = 1; function = keymap[x][y] - '0'; tx = keymap_to_map0[function][0]; @@ -323,14 +323,14 @@ int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, i } if (x < 7) x = 7, y = 1; - now_x = x, now_y = y; //返回x y + now_x = x, now_y = y; //杩斿洖x y gotoxy(tx, ty); - printf("%s", point[point_flag + 2]); //输出空格消除 + printf("%s", point[point_flag + 2]); //杈撳嚭绌烘牸娑堥櫎 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10 | 1); return function; } -void show_message(int id) //显示第id条消息 难在显示输出的处理 +void show_message(int id) //鏄剧ず绗琲d鏉℃秷鎭 闅惧湪鏄剧ず杈撳嚭鐨勫鐞 { int i; gotoxy(17, 3); @@ -345,18 +345,18 @@ int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, i gotoxy(tx + 3, ty); printf(" "); } - if (id == -1) //假装没捞到 + if (id == -1) //鍋囪娌℃崬鍒 { int flag = rand() % 4; gotoxy(17, 3); if (flag == 0) - printf("哇,好大一只螃蟹。放生 或 再捞捞看 "); + printf("鍝囷紝濂藉ぇ涓鍙瀮锜广傛斁鐢 鎴 鍐嶆崬鎹炵湅 "); else if (flag == 1) - printf("鱼儿水中游,来去乐悠悠。再捞捞看 "); + printf("楸煎効姘翠腑娓革紝鏉ュ幓涔愭偁鎮犮傚啀鎹炴崬鐪 "); else if (flag == 2) - printf("捞到个锤子。放生 或 再捞捞看 "); + printf("鎹炲埌涓敜瀛愩傛斁鐢 鎴 鍐嶆崬鎹炵湅 "); else if (flag == 3) - printf("捞到一个破瓶子,里面什么都没有。 "); + printf("鎹炲埌涓涓牬鐡跺瓙锛岄噷闈粈涔堥兘娌℃湁銆 "); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10 | 1); return; } @@ -370,7 +370,7 @@ int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, i { if (i == 5 && cnt == 1) { - printf("…"); + printf("鈥"); cnt--; break; } @@ -388,7 +388,7 @@ int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, i SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10 | 1); } -void show_page(int page) //显示第几的页面 +void show_page(int page) //鏄剧ず绗嚑鐨勯〉闈 { int start = (page - 1) * page_include; int end = page * page_include; @@ -414,7 +414,7 @@ int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, i SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10 | 1); } -void throw_bottle() //扔漂流瓶 == 增加功能 这里难在处理输入 +void throw_bottle() //鎵旀紓娴佺摱 == 澧炲姞鍔熻兘 杩欓噷闅惧湪澶勭悊杈撳叆 { int i; HideCursor(1); @@ -427,14 +427,14 @@ int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, i } gotoxy(17, 3); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10 | 4); - printf(" ||在此输入不越线的用户名 "); + printf(" ||鍦ㄦ杈撳叆涓嶈秺绾跨殑鐢ㄦ埛鍚 "); char username[100]; gotoxy(17, 3); scanf("%s", username); if (strlen(username) > 10) { gotoxy(17, 2); - printf("用户名过长,错误输入,按回车退回 "); + printf("鐢ㄦ埛鍚嶈繃闀,閿欒杈撳叆锛屾寜鍥炶溅閫鍥 "); getchar(); getchar(); change_menu(menu_flag); @@ -443,9 +443,9 @@ int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, i else { gotoxy(17, 2); - printf("成功输入,%10s| ", username); + printf("鎴愬姛杈撳叆,%10s| ", username); gotoxy(17, 3); - printf("文字输入请自行按回车换行 "); + printf("鏂囧瓧杈撳叆璇疯嚜琛屾寜鍥炶溅鎹㈣ "); } int index = 0; char res[500] = "\0"; @@ -466,7 +466,7 @@ int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, i All_messages++; All_pages = (All_messages % page_include == 0 ? All_messages / page_include : All_messages / page_include + 1); gotoxy(17, 2); - printf("漂流瓶已扔入大海,回车返回"); + printf("婕傛祦鐡跺凡鎵斿叆澶ф捣锛屽洖杞﹁繑鍥"); getchar(); getchar(); menu_flag = 1; @@ -474,27 +474,27 @@ int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, i HideCursor(0); } -void manchange() //人为输入更新 +void manchange() //浜轰负杈撳叆鏇存柊 { char ch, ch1; if (kbhit()) { function = move(now_x, now_y, 1, 7, 1, 4, 1, 1); - if (function >= 0 && function <= 5) //查看留言面板第m页的第n+1条 + if (function >= 0 && function <= 5) //鏌ョ湅鐣欒█闈㈡澘绗琺椤电殑绗琻+1鏉 { menu_flag++; - show_message((page - 1) * page_include + function); //取数据库第几条 + show_message((page - 1) * page_include + function); //鍙栨暟鎹簱绗嚑鏉 } - if (function == 6) //返回 + if (function == 6) //杩斿洖 { if (menu_flag <= 2) - { //查看所有留言返回菜单 + { //鏌ョ湅鎵鏈夌暀瑷杩斿洖鑿滃崟 menu_flag = 1; change_menu(menu_flag); } if (menu_flag == 3) - { //所有留言查看详细 返回 留言 + { //鎵鏈夌暀瑷鏌ョ湅璇︾粏 杩斿洖 鐣欒█ menu_flag--; show_page(page); } @@ -502,11 +502,11 @@ int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, i else if (function == 7) { if (menu_flag == 1) - { //扔一个 + { //鎵斾竴涓 throw_bottle(); } else - { //上一页 + { //涓婁竴椤 if (page > 1) { menu_flag = 2; @@ -516,15 +516,15 @@ int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, i } else if (function == 8) { - if (menu_flag == 1) //捞捞看 + if (menu_flag == 1) //鎹炴崬鐪 { if (rand() % 3 == 1) - show_message(-1); //没捞到 + show_message(-1); //娌℃崬鍒 else - show_message(rand() % All_messages); //随机数 + show_message(rand() % All_messages); //闅忔満鏁 } else - { //下一页 + { //涓嬩竴椤 if (page < All_pages) { menu_flag = 2; @@ -549,15 +549,15 @@ int move(int x, int y, int limit_x1, int limit_x2, int limit_y1, int limit_y2, i printf("%s", point[point_flag]); } } -void autochange() //自动更新 +void autochange() //鑷姩鏇存柊 { - //无 + //鏃 } int main() { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10 | 1); //SetConsoleTextAttribute - //设置控制台窗口字体颜色和背景色的 + //璁剧疆鎺у埗鍙扮獥鍙e瓧浣撻鑹插拰鑳屾櫙鑹茬殑 init(); while (1) { diff --git "a/\347\245\236\345\272\231\351\200\203\344\272\241/\347\245\236\345\272\231\351\200\203\344\272\241.txt" "b/\347\245\236\345\272\231\351\200\203\344\272\241/\347\245\236\345\272\231\351\200\203\344\272\241.txt" index fb20a98..b44720d 100644 --- "a/\347\245\236\345\272\231\351\200\203\344\272\241/\347\245\236\345\272\231\351\200\203\344\272\241.txt" +++ "b/\347\245\236\345\272\231\351\200\203\344\272\241/\347\245\236\345\272\231\351\200\203\344\272\241.txt" @@ -1,29 +1,29 @@ -#include //用于getch() +#include //鐢ㄤ簬getch锛堬級 #include #include #include /*-------------------------------- -1.a方向测试 -2.方向测试 -3.刷新方面 转弯后没刷新 -2.加入开头动画 -3.设置迷宫 -4.加载自动前进 +1.a鏂瑰悜娴嬭瘯 +2.鏂瑰悜娴嬭瘯 +3.鍒锋柊鏂归潰 杞集鍚庢病鍒锋柊 +2.鍔犲叆寮澶村姩鐢 +3.璁剧疆杩峰 +4.鍔犺浇鑷姩鍓嶈繘 -加入路线系统 +鍔犲叆璺嚎绯荤粺 -5.优化小人 -6.设计地图(初始死亡地不允许再次出现) -7.设置死亡 -8设计8对应正确路劲的颜色 +5.浼樺寲灏忎汉 +6.璁捐鍦板浘锛堝垵濮嬫浜″湴涓嶅厑璁稿啀娆″嚭鐜帮級 +7.璁剧疆姝讳骸 +8璁捐8瀵瑰簲姝g‘璺姴鐨勯鑹 -------------------------------*/ -int x, y, lx, ly, rx, ry, old_lx, old_ly, old_rx, old_ry, end_rx, end_ry, end_lx, end_ly; //(奇数 偶数 负数(死亡)) +int x, y, lx, ly, rx, ry, old_lx, old_ly, old_rx, old_ry, end_rx, end_ry, end_lx, end_ly; //(濂囨暟 鍋舵暟 璐熸暟锛堟浜★級) int time = 15000, change_time = 5000; -//下一步移动 +//涓嬩竴姝ョЩ鍔 int next[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; //w 0 s 1 a 2 d 3 int next_turn = 0, if_die = 0, if_start = 0, if_cheat = 0, if_pass = 0; int automove; @@ -33,11 +33,11 @@ struct step_move int x; int y; } s[1000000]; -//w a d s 对应出0 1 2 3数组 +//w a d s 瀵瑰簲鍑0 1 2 3鏁扮粍 int ch_to_num[128] = {0}; -//相应显示 -char turn_to_show[11] = {" o#$%^&(*X"}; //0对应空 2对应前方不可通行 5对应地刺 8对应达到正确的路劲 9对应死亡 +//鐩稿簲鏄剧ず +char turn_to_show[11] = {" o#$%^&(*X"}; //0瀵瑰簲绌 2瀵瑰簲鍓嶆柟涓嶅彲閫氳 5瀵瑰簲鍦板埡 8瀵瑰簲杈惧埌姝g‘鐨勮矾鍔 9瀵瑰簲姝讳骸 char people_mod[7][20] = { {" 0 "}, {" +/+ /"}, @@ -45,7 +45,7 @@ char people_mod[7][20] = { {" +-+ "}, {" / / "}, {"o o "}}; -//9个区域信息 +//9涓尯鍩熶俊鎭 int turn[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, Ahead_on = 0, ahead_on = 0; char mmap[1000][1000]; @@ -134,30 +134,30 @@ int num_map1[100][100] = { {1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}; char map1[200][500] = { {"+-------------------------------------------------+"}, //0 - {"|\\ {} 神 庙 逃 亡 {} /|"}, //1 + {"|\\ {} 绁 搴 閫 浜 {} /|"}, //1 {"| \\ {} ----- ----- {} / |"}, //2 1 {"| \\ *-->----------------<--* / |"}, //3 {"| \\ / |"}, //4 - {"| \\ *-* !游 戏 开 始 !*-* / |"}, //5 + {"| \\ *-* 锛佹父 鎴 寮 濮 锛*-* / |"}, //5 {"| \\ / |"}, //6 {"| \\ *-->----------------<--* / |"}, //7 {"| \\ / |"}, //8 {"| \\ / |"}, //9 8 - {"| \\ / |"}, //10 *9个 + {"| \\ / |"}, //10 *9涓 {"| +\\---------------------------/+ |"}}; //11 -char map[200][500] = { //图形界面 +char map[200][500] = { //鍥惧舰鐣岄潰 {"+-------------------------------------------------+"}, //0 - {"|\\ {} 菜 单 界 面 {} /|"}, //1 + {"|\\ {} 鑿 鍗 鐣 闈 {} /|"}, //1 {"| \\ {} ----- ----- {} / |"}, //2 1 - {"| \\ 寻找神庙的终点 / |"}, //3 + {"| \\ 瀵绘壘绁炲簷鐨勭粓鐐 / |"}, //3 {"| \\ / |"}, //4 - {"| \\ *-* 按空格开始游戏 *-* / |"}, //5 + {"| \\ *-* 鎸夌┖鏍煎紑濮嬫父鎴 *-* / |"}, //5 {"| \\ / |"}, //6 - {"| \\ *--> 左右<->控制游戏 <--* / |"}, //7 + {"| \\ *--> 宸﹀彸<->鎺у埗娓告垙 <--* / |"}, //7 {"| \\ / |"}, //8 - {"| \\ *--> - + 调速: <--* / |"}, //9 8 - {"| \\ (菜单界面还不能控制游戏的) / |"}, //10 *9个 + {"| \\ *--> - + 璋冮燂細 <--* / |"}, //9 8 + {"| \\ (鑿滃崟鐣岄潰杩樹笉鑳芥帶鍒舵父鎴忕殑) / |"}, //10 *9涓 {"| +\\---------------------------/+ |"}, //11 {"| | \\ / | |"}, //12 {"| | \\ / | |"}, //13 @@ -187,7 +187,7 @@ char map[200][500] = { //图 {"| / | \\ |"}, //37 {"|/ | \\|"}, //38 {"+-------------------------------------------------+"}}; //39 -void gotoxy(int x, int y) //坐标函数 +void gotoxy(int x, int y) //鍧愭爣鍑芥暟 { HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); COORD pos; @@ -196,25 +196,25 @@ void gotoxy(int x, int y) // SetConsoleCursorPosition(handle, pos); } void loading() -{ //按一下提示注意切换英文输入 +{ //鎸変竴涓嬫彁绀烘敞鎰忓垏鎹㈣嫳鏂囪緭鍏 char ch; int n = 11, m; int i, j, k, min = 0, max, ti = 0, tj = 0; int step = 0; char messge[7][15] = { - {" 3D神庙逃亡 "}, - {" C语言精简版 "}, - {" made by 绝伦N"}, + {" 3D绁炲簷閫冧骸 "}, + {" C璇█绮剧畝鐗 "}, + {" made by 缁濅鸡N"}, {" "}, - {" 加载菜单界面 "}, - {" 按任意键继续 "}}; + {" 鍔犺浇鑿滃崟鐣岄潰 "}, + {" 鎸変换鎰忛敭缁х画 "}}; char messge1[7][15] = { - {" 恭喜通关!!"}, - {" 恭喜通关!!"}, - {" 恭喜通关!!"}, + {" 鎭枩閫氬叧锛侊紒"}, + {" 鎭枩閫氬叧锛侊紒"}, + {" 鎭枩閫氬叧锛侊紒"}, {" "}, - {" 按空格重置 "}, - {" 按其他键结束 "}}; + {" 鎸夌┖鏍奸噸缃 "}, + {" 鎸夊叾浠栭敭缁撴潫 "}}; system("color 05"); system("mode con cols=52 lines=42"); m = 5 + n * 4; @@ -335,7 +335,7 @@ void init() int n = 40, i; system("color 07"); system("mode con cols=52 lines=42"); - memcpy(num_map, num_map1, sizeof(num_map1)); //复制地图,用于重新开始。 + memcpy(num_map, num_map1, sizeof(num_map1)); //澶嶅埗鍦板浘锛岀敤浜庨噸鏂板紑濮嬨 ch_to_num['w'] = 0; ch_to_num['s'] = 1; ch_to_num['a'] = 2; @@ -345,7 +345,7 @@ void init() automove = time; Ahead_on = 0, ahead_on = 0; if (if_start == 1) - { //正式开始游戏; + { //姝e紡寮濮嬫父鎴忥紱 1; x = 26; y = 1; @@ -674,7 +674,7 @@ void Ahead(int t) //8 top(t); } } -void stop() //游戏结束加载 +void stop() //娓告垙缁撴潫鍔犺浇 { char ch; int c, d, i; @@ -730,10 +730,10 @@ void show() num_map[x][y] = 9; x = 0, y = 0; } - //识别左边 + //璇嗗埆宸﹁竟 tx = (next_turn == 2 || next_turn == 3) ? lx - next[next_turn][1] : lx + next[next_turn][1]; ty = (next_turn == 2 || next_turn == 3) ? ly - next[next_turn][0] : ly + next[next_turn][0]; - if (num_map[tx][ty] != turn[0]) //lx ly相对运动方向的左边 + if (num_map[tx][ty] != turn[0]) //lx ly鐩稿杩愬姩鏂瑰悜鐨勫乏杈 { turn[0] = num_map[tx][ty]; Left1(turn[0]); @@ -742,14 +742,14 @@ void show() printf("%d", num_map[tx][ty]);*/ tx = tx + next[next_turn][0], ty = ty + next[next_turn][1]; - if (num_map[tx][ty] != turn[1]) //左前方 + if (num_map[tx][ty] != turn[1]) //宸﹀墠鏂 { turn[1] = num_map[tx][ty]; Left2(turn[1]); //1 } /* gotoxy(0, 44); printf("%d", num_map[tx][ty]);*/ - if (num_map[lx][ly] != turn[2] || (lx == x && ly == y)) //原地 + if (num_map[lx][ly] != turn[2] || (lx == x && ly == y)) //鍘熷湴 { if (lx == x && ly == y && turn[2] == -2) 1; @@ -764,7 +764,7 @@ void show() left1(turn[2]); //2} } } - if (num_map[lx + next[next_turn][0]][ly + next[next_turn][1]] != turn[3]) //相对运动方向的前边 + if (num_map[lx + next[next_turn][0]][ly + next[next_turn][1]] != turn[3]) //鐩稿杩愬姩鏂瑰悜鐨勫墠杈 { turn[3] = num_map[lx + next[next_turn][0]][ly + next[next_turn][1]]; if (turn[3] == 9 && num_map[rx + next[next_turn][0]][ry + next[next_turn][0]] != 0) @@ -772,10 +772,10 @@ void show() left2(turn[3]); //3 } - //识别右边 + //璇嗗埆鍙宠竟 tx = (next_turn == 2 || next_turn == 3) ? rx + next[next_turn][1] : rx - next[next_turn][1]; ty = (next_turn == 2 || next_turn == 3) ? ry + next[next_turn][0] : ry - next[next_turn][0]; - if (num_map[rx + next[next_turn][1]][ry - next[next_turn][0]] != turn[4]) //相对运动方向的右边 + if (num_map[rx + next[next_turn][1]][ry - next[next_turn][0]] != turn[4]) //鐩稿杩愬姩鏂瑰悜鐨勫彸杈 { turn[4] = num_map[rx + next[next_turn][1]][ry - next[next_turn][0]]; Right1(turn[4]); //4 @@ -813,8 +813,8 @@ void show() turn[8] = 9; right2(turn[7]); //7 } - //由于识别前面造成的把之后的刷新; - //识别前面 + //鐢变簬璇嗗埆鍓嶉潰閫犳垚鐨勬妸涔嬪悗鐨勫埛鏂帮紱 + //璇嗗埆鍓嶉潰 if (num_map[lx + next[next_turn][0]][ly + next[next_turn][1]] && num_map[rx + next[next_turn][0]][ry + next[next_turn][1]]) { @@ -909,10 +909,10 @@ void withinput() if (kbhit()) { char ch = getch(); - if (if_start == 1 && (ch == 'a' || ch == 'd' || ch == 'w' || ch == -32)) //开始游戏了 + if (if_start == 1 && (ch == 'a' || ch == 'd' || ch == 'w' || ch == -32)) //寮濮嬫父鎴忎簡 { if (ch == -32) - { //同时启用wasd 和上下左右键 //如果读取到第一个是-32那么 继续读取一个字符 + { //鍚屾椂鍚敤wasd 鍜屼笂涓嬪乏鍙抽敭 //濡傛灉璇诲彇鍒扮涓涓槸-32閭d箞 缁х画璇诲彇涓涓瓧绗 char ch1 = getch(); switch (ch1) { @@ -1030,20 +1030,20 @@ void withinput() } } } - else if (if_start == 0 && ch == ' ') //空格开始游戏 + else if (if_start == 0 && ch == ' ') //绌烘牸寮濮嬫父鎴 { if_start = 1; init(); return; } - else if (if_start == 0 && ch == '+') //按G一键开挂(浏览模式) + else if (if_start == 0 && ch == '+') //鎸塆涓閿紑鎸傦紙娴忚妯″紡锛 { time = time + change_time; gotoxy(27, 9); printf("%6d", time); } else if (if_start == 0 && ch == '-') - { //调节速度 + { //璋冭妭閫熷害 if (time >= change_time) { time = time - change_time; diff --git "a/\347\256\200\350\260\261\346\222\255\346\224\276\345\231\250/C\351\237\263\344\271\220\351\237\263\344\271\220/Tips.txt" "b/\347\256\200\350\260\261\346\222\255\346\224\276\345\231\250/C\351\237\263\344\271\220\351\237\263\344\271\220/Tips.txt" index 4f20ce3..21f6bb9 100644 --- "a/\347\256\200\350\260\261\346\222\255\346\224\276\345\231\250/C\351\237\263\344\271\220\351\237\263\344\271\220/Tips.txt" +++ "b/\347\256\200\350\260\261\346\222\255\346\224\276\345\231\250/C\351\237\263\344\271\220\351\237\263\344\271\220/Tips.txt" @@ -1,16 +1,16 @@ -程序内涵:Bad Apple,碎月,千与千寻,Astronomia 音乐简谱。 +绋嬪簭鍐呮兜锛欱ad Apple锛岀鏈堬紝鍗冧笌鍗冨锛孉stronomia 闊充箰绠璋便 -注意事项: -1.Beep()函数声音后面会带有振膜的噪音,目前无法解决 -2.进入程序出现音画不同步需要人工开启音响(即音乐播放器随便播放一首歌即可) -3.程序对电脑产生影响未知,请谨慎使用。 -4.请在结尾带上END才能停止输入。 -5.关于速度问题,可以自己去原函数调整quarter_time变量即1/4拍子持续时间,默认300毫秒,官方400毫秒;目前内可识别1/8拍,1/16拍,1/2拍,详细见程序 +娉ㄦ剰浜嬮」锛 +1.Beep锛堬級鍑芥暟澹伴煶鍚庨潰浼氬甫鏈夋尟鑶滅殑鍣煶锛岀洰鍓嶆棤娉曡В鍐 +2.杩涘叆绋嬪簭鍑虹幇闊崇敾涓嶅悓姝ラ渶瑕佷汉宸ュ紑鍚煶鍝嶏紙鍗抽煶涔愭挱鏀惧櫒闅忎究鎾斁涓棣栨瓕鍗冲彲锛 +3.绋嬪簭瀵圭數鑴戜骇鐢熷奖鍝嶆湭鐭ワ紝璇疯皑鎱庝娇鐢ㄣ +4.璇峰湪缁撳熬甯︿笂END鎵嶈兘鍋滄杈撳叆銆 +5.鍏充簬閫熷害闂锛屽彲浠ヨ嚜宸卞幓鍘熷嚱鏁拌皟鏁磓uarter_time鍙橀噺鍗1/4鎷嶅瓙鎸佺画鏃堕棿锛岄粯璁300姣锛屽畼鏂400姣;鐩墠鍐呭彲璇嗗埆1/8鎷嶏紝1/16鎷嶏紝1/2鎷嶏紝璇︾粏瑙佺▼搴 -乐谱区域: +涔愯氨鍖哄煙锛 - C语言简谱 - 【Bad Apple】 + C璇█绠璋 + 銆怋ad Apple銆 |6 7 1' 2' 3' 6' 5' |3' 6 3' 2' 1' 7 |6 7' 1' 2' 3' 2' 1' ||||7 6 7 1' 7 6 5 7 |||||||||| |6 7 1' 2' 3' 6' 5' |3' 6 3' 2' 1' 7 |6 7' 1' 2' 3' 2' 1' ||||7 1' 2' 3' |||||||||||| |6. 7. 1 2 3 6 5 ||||3 6. 3 2 1 7. |||6. 7. 1 2 3 2 1 ||||7. 6. 7. 1 7. 6. 5. 7. |||||||| @@ -19,18 +19,18 @@ |5 6 3 2 3 2 3 ||||||5 6 3 2 3 6 7 ||||1' 7 6 5 3 2 3 |||||2 1 7. 5. 6. 3' 5' ||||||||||| |5' 6' 3' 2' 3' 2' 3' ||5' 6' 3' 2' 3' 2' 3' ||2' 1' 7 5 6 5 6 |7 1' 2' 3' 6 3 5 |||||||| |5 6 3 2 3 2 3 |||||||||5 6 3 2 3 6 7 ||1' 7 6 5 3 2 3 |||||2 1 7. 5. 6. 3 5 ||||||||||| - 【{碎月}】 + 銆恵纰庢湀}銆 |3. 5. 6. 1 2 1 2 3 |1 6. 5. 3. 1 2 6. ||6. 1 2 1 2 3 5 6 1' ||||||||||||||||||||||||||| |7 67 6 5 6 |||5 3 2 3 1 2 1 2 3 6. 12 1 6. 6. 5. 6. 6 1 3 2 5 6 |||||||||||||||||||| |3. 5. 5 6 3 2 3 |1 2 7. 1 7. 5. 6. ||3. 5. 6. 1 2 1 2 2 1 2 1 2 5 3 ||||||||||||||||||| |3 5 6 5 6 3 3 1 23 21 6. |6. 5. 6. 5. 6. 1 2 1 5 6 |||||||||||||||||||||||||||||||||| - 【{千与千寻}】 + 銆恵鍗冧笌鍗冨}銆 |1 5 3' |||||1 5 3' |||1 5 3' |||1 5 1 2||3 1 5 3 |||2 5 2 |||1 6. 3 1 || |7. 0 1 7. ||||6. 7. 1 2 |5. 1 2 3 ||4 43 21 |||2 1 2 |||||3 1 5 3 ||2 5 2 |||| |1 6. 6. 7. 1 |5. 0 0 5. |||6. 7. 1 2 |5. 1 2 3 |4 4 3 2 1 |||1 0 0 3 4 ||5 5 5 ||| |5 5 6 5 4 ||||3 3 3 |||3 3 4 3 2 |||1 1 1 7. |6. 0 7. 7. 1|2 2 3 2 3 |2 3 4 ||||| |5 5 5 |5 5 6 5 4 |3 3 3 |3 4 3 2 1 7. |6. 0 6. 7. 1 2 |5. 1 2 3 |2 2 2 1 1 || - 【{Astronomia}】 + 銆恵Astronomia}銆 |4 4 4 4 6 6 6 6 |5 5 5 5 1' 1' 1' 1' |2' 2' 2' 2' 2' 2' 2' 2' |5 4 3 1 2 0 2 6 ||||||||||||| |5 0 4 0 3 0 3 3 |5 0 4 3 2 0 2 3' ||||2' 3' 2' 3' 2 0 2 3' ||||2' 3' 2' 3' 2 0 2 6 ||||||||| |5 0 4 0 3 0 3 3 |5 0 4 3 2 0 2 3' ||||2' 3' 2' 3' 2 0 2 3' ||||2' 3' 2' 3' 4 4 4 4 ||||||||| diff --git "a/\347\256\200\350\260\261\346\222\255\346\224\276\345\231\250/C\351\237\263\344\271\220\351\237\263\344\271\220/\350\207\252\350\241\214\347\274\226\350\257\221.txt" "b/\347\256\200\350\260\261\346\222\255\346\224\276\345\231\250/C\351\237\263\344\271\220\351\237\263\344\271\220/\350\207\252\350\241\214\347\274\226\350\257\221.txt" index 462dcd9..9abeed9 100644 --- "a/\347\256\200\350\260\261\346\222\255\346\224\276\345\231\250/C\351\237\263\344\271\220\351\237\263\344\271\220/\350\207\252\350\241\214\347\274\226\350\257\221.txt" +++ "b/\347\256\200\350\260\261\346\222\255\346\224\276\345\231\250/C\351\237\263\344\271\220\351\237\263\344\271\220/\350\207\252\350\241\214\347\274\226\350\257\221.txt" @@ -2,7 +2,7 @@ #include #include -void gotoxy(int x, int y) //坐标函数 +void gotoxy(int x, int y) //鍧愭爣鍑芥暟 { HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); COORD pos; @@ -11,33 +11,33 @@ void gotoxy(int x, int y) // SetConsoleCursorPosition(handle, pos); } // 0 1 2 3 4 5 -//半低音 低音 半中音 中音 半高音 高音 -int Alto[8] = {0, 523, 578, 659, 698, 784, 880, 988}; //中音 -int Bass[8] = {0, 262, 294, 330, 349, 392, 440, 494}; //低音 -int Treble[8] = {0, 1046, 1175, 1318, 1480, 1568, 1760, 1976}; //高音 -int half_Alto[8] = {0, 554, 622, 0, 740, 831, 932, 0}; //半中音 -int half_Bass[8] = {0, 277, 311, 0, 370, 415, 466, 0}; //半低音 -int half_Treble[8] = {0, 1046, 1245, 0, 1480, 1661, 1865, 0}; //半高音 +//鍗婁綆闊 浣庨煶 鍗婁腑闊 涓煶 鍗婇珮闊 楂橀煶 +int Alto[8] = {0, 523, 578, 659, 698, 784, 880, 988}; //涓煶 +int Bass[8] = {0, 262, 294, 330, 349, 392, 440, 494}; //浣庨煶 +int Treble[8] = {0, 1046, 1175, 1318, 1480, 1568, 1760, 1976}; //楂橀煶 +int half_Alto[8] = {0, 554, 622, 0, 740, 831, 932, 0}; //鍗婁腑闊 +int half_Bass[8] = {0, 277, 311, 0, 370, 415, 466, 0}; //鍗婁綆闊 +int half_Treble[8] = {0, 1046, 1245, 0, 1480, 1661, 1865, 0}; //鍗婇珮闊 int music[60] = {0}; char music_map[1000][100]; int line; -int quarter_time; //标准是400,但有时候会慢,有需求调整这里 +int quarter_time; //鏍囧噯鏄400锛屼絾鏈夋椂鍊欎細鎱紝鏈夐渶姹傝皟鏁磋繖閲 void insert() { int i = 0, j = 0; - printf("tip:如果音画不同步,只要随便音乐播放器播放一首歌即可!!!!!!!!!!!!!!!!!\n"); - printf("听到一次鸣笛表示环境正常,软件缺点有细微的鼓点杂音,并且对电脑造成影响未知,请谨慎使用\n"); - printf("程序课查看源码自带乐谱\n"); - printf("简谱规则:1.每行以回车结尾,结尾另起一行写上“END”即视为输入结束\n"); - printf("简谱格式:数字+音阶+持续时长 \n\n"); - printf("数字区 : 1-7即可\n"); - printf("音阶区 : 高音(')低音(.)中音(不填)半低音(-)半高音(+)半中音(*)\n"); - printf("时长区 : 一个空格对应1/8音符 两个空格1/4音符 无空格1/16音符 空格越多延长1/8个音符\n"); - printf("总结: 数字+音阶+持续时长 + ||修饰 + 另起一行END结尾 即是简谱\n"); - printf("示例 <====> |1' 2. 3 4 1234|为一个小节\n"); - printf("输入是任意的,直到END行结束,但请不要输入空白行\n"); - printf("此处可以输入了 记得END另起一行结尾喔\n"); + printf("tip:濡傛灉闊崇敾涓嶅悓姝ワ紝鍙闅忎究闊充箰鎾斁鍣ㄦ挱鏀句竴棣栨瓕鍗冲彲锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒锛乗n"); + printf("鍚埌涓娆¢福绗涜〃绀虹幆澧冩甯革紝杞欢缂虹偣鏈夌粏寰殑榧撶偣鏉傞煶锛屽苟涓斿鐢佃剳閫犳垚褰卞搷鏈煡锛岃璋ㄦ厧浣跨敤\n"); + printf("绋嬪簭璇炬煡鐪嬫簮鐮佽嚜甯︿箰璋盶n"); + printf("绠璋辫鍒欙細1.姣忚浠ュ洖杞︾粨灏撅紝缁撳熬鍙﹁捣涓琛屽啓涓娾淓ND鈥濆嵆瑙嗕负杈撳叆缁撴潫\n"); + printf("绠璋辨牸寮忥細鏁板瓧+闊抽樁+鎸佺画鏃堕暱 \n\n"); + printf("鏁板瓧鍖 锛 1-7鍗冲彲\n"); + printf("闊抽樁鍖 锛 楂橀煶(')浣庨煶(.)涓煶(涓嶅~)鍗婁綆闊(-)鍗婇珮闊筹紙+锛夊崐涓煶(*)\n"); + printf("鏃堕暱鍖 锛 涓涓┖鏍煎搴1/8闊崇 涓や釜绌烘牸1/4闊崇 鏃犵┖鏍1/16闊崇 绌烘牸瓒婂寤堕暱1/8涓煶绗n"); + printf("鎬荤粨锛 鏁板瓧+闊抽樁+鎸佺画鏃堕暱 + ||淇グ + 鍙﹁捣涓琛孍ND缁撳熬 鍗虫槸绠璋盶n"); + printf("绀轰緥 <====> |1' 2. 3 4 1234|涓轰竴涓皬鑺俓n"); + printf("杈撳叆鏄换鎰忕殑锛岀洿鍒癊ND琛岀粨鏉燂紝浣嗚涓嶈杈撳叆绌虹櫧琛孿n"); + printf("姝ゅ鍙互杈撳叆浜 璁板緱END鍙﹁捣涓琛岀粨灏惧枖\n"); while (1) { scanf("%[^\n]", music_map[i]); @@ -73,35 +73,35 @@ void play() SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 03); printf("%c", music_map[i][j]); if (music_map[i][j + 1] == '.') - { //高音区50 + { //楂橀煶鍖50 rate = music_map[i][j] - '0' + 10; gotoxy(j + 1, i); printf("%c", music_map[i][j + 1]); j += 2; } else if (music_map[i][j + 1] == '\'') - { //高音区50 + { //楂橀煶鍖50 rate = music_map[i][j] - '0' + 50; gotoxy(j + 1, i); printf("%c", music_map[i][j + 1]); j += 2; } else if (music_map[i][j + 1] == '-') - { //半低区0 + { //鍗婁綆鍖0 rate = music_map[i][j] - '0' + 0; gotoxy(j + 1, i); printf("%c", music_map[i][j + 1]); j += 2; } else if (music_map[i][j + 1] == '*') - { //半中音区20 + { //鍗婁腑闊冲尯20 rate = music_map[i][j] - '0' + 20; gotoxy(j + 1, i); printf("%c", music_map[i][j + 1]); j += 2; } else if (music_map[i][j + 1] == '+') - { //半高音区40 + { //鍗婇珮闊冲尯40 rate = music_map[i][j] - '0' + 40; gotoxy(j + 1, i); printf("%c", music_map[i][j + 1]); @@ -109,12 +109,12 @@ void play() } else { - rate = music_map[i][j] - '0' + 30; //中音区30 + rate = music_map[i][j] - '0' + 30; //涓煶鍖30 j++; } while (music_map[i][j] == ' ') { - time += quarter_time / 2; //加间隔1/8音符 + time += quarter_time / 2; //鍔犻棿闅1/8闊崇 j++; } j--; @@ -132,13 +132,13 @@ void play() int main() { // 800 1/2 - // 400 中等1/4 + // 400 涓瓑1/4 // 200 1/8 - //默认1/4音符 + //榛樿1/4闊崇 int n, i, j, res; char ch; system("color 07"); - quarter_time = 300; //标准是400,但有时候会慢,有需求调整这里 + quarter_time = 300; //鏍囧噯鏄400锛屼絾鏈夋椂鍊欎細鎱紝鏈夐渶姹傝皟鏁磋繖閲 for (i = 0; i < 6; i++) { @@ -159,11 +159,11 @@ int main() } } Beep(music[31], 400); - printf("直接输入END回车即可进入训练模式\n"); + printf("鐩存帴杈撳叆END鍥炶溅鍗冲彲杩涘叆璁粌妯″紡\n"); insert(); play(); - printf("\nq : 半低音 w:半中音 e:半高音\n"); - printf("a : 低音 s:中音 d:高音\n"); + printf("\nq : 鍗婁綆闊 w锛氬崐涓煶 e锛氬崐楂橀煶\n"); + printf("a : 浣庨煶 s锛氫腑闊 d锛氶珮闊砛n"); res = 30; while (ch = getch()) @@ -177,37 +177,37 @@ int main() { res = 10; gotoxy(0, 0); - printf("低音 "); + printf("浣庨煶 "); } else if (ch == 's') { res = 30; gotoxy(0, 0); - printf("中音 "); + printf("涓煶 "); } else if (ch == 'd') { res = 50; gotoxy(0, 0); - printf("高音 "); + printf("楂橀煶 "); } else if (ch == 'q') { res = 0; gotoxy(0, 0); - printf("半低音 "); + printf("鍗婁綆闊 "); } else if (ch == 'w') { res = 20; gotoxy(0, 0); - printf("半中音 "); + printf("鍗婁腑闊 "); } else if (ch == 'e') { res = 40; gotoxy(0, 0); - printf("半高音 "); + printf("鍗婇珮闊 "); } } return 0; @@ -216,8 +216,8 @@ int main() /* - C语言简谱 - 【Bad Apple】 + C璇█绠璋 + 銆怋ad Apple銆 |6 7 1' 2' 3' 6' 5' |3' 6 3' 2' 1' 7 |6 7' 1' 2' 3' 2' 1' ||||7 6 7 1' 7 6 5 7 |||||||||| |6 7 1' 2' 3' 6' 5' |3' 6 3' 2' 1' 7 |6 7' 1' 2' 3' 2' 1' ||||7 1' 2' 3' |||||||||||| |6. 7. 1 2 3 6 5 ||||3 6. 3 2 1 7. |||6. 7. 1 2 3 2 1 ||||7. 6. 7. 1 7. 6. 5. 7. |||||||| @@ -226,18 +226,18 @@ int main() |5 6 3 2 3 2 3 ||||||5 6 3 2 3 6 7 ||||1' 7 6 5 3 2 3 |||||2 1 7. 5. 6. 3' 5' ||||||||||| |5' 6' 3' 2' 3' 2' 3' ||5' 6' 3' 2' 3' 2' 3' ||2' 1' 7 5 6 5 6 |7 1' 2' 3' 6 3 5 |||||||| |5 6 3 2 3 2 3 |||||||||5 6 3 2 3 6 7 ||1' 7 6 5 3 2 3 |||||2 1 7. 5. 6. 3 5 ||||||||||| - 【{碎月}】 + 銆恵纰庢湀}銆 |3. 5. 6. 1 2 1 2 3 |1 6. 5. 3. 1 2 6. ||6. 1 2 1 2 3 5 6 1' ||||||||||||||||||||||||||| |7 67 6 5 6 |||5 3 2 3 1 2 1 2 3 6. 12 1 6. 6. 5. 6. 6 1 3 2 5 6 |||||||||||||||||||| |3. 5. 5 6 3 2 3 |1 2 7. 1 7. 5. 6. ||3. 5. 6. 1 2 1 2 2 1 2 1 2 5 3 ||||||||||||||||||| |3 5 6 5 6 3 3 1 23 21 6. |6. 5. 6. 5. 6. 1 2 1 5 6 |||||||||||||||||||||||||||||||||| - 【{千与千寻}】 + 銆恵鍗冧笌鍗冨}銆 |1 5 3' |||||1 5 3' |||1 5 3' |||1 5 1 2||3 1 5 3 |||2 5 2 |||1 6. 3 1 || |7. 0 1 7. ||||6. 7. 1 2 |5. 1 2 3 ||4 43 21 |||2 1 2 |||||3 1 5 3 ||2 5 2 |||| |1 6. 6. 7. 1 |5. 0 0 5. |||6. 7. 1 2 |5. 1 2 3 |4 4 3 2 1 |||1 0 0 3 4 ||5 5 5 ||| |5 5 6 5 4 ||||3 3 3 |||3 3 4 3 2 |||1 1 1 7. |6. 0 7. 7. 1|2 2 3 2 3 |2 3 4 ||||| |5 5 5 |5 5 6 5 4 |3 3 3 |3 4 3 2 1 7. |6. 0 6. 7. 1 2 |5. 1 2 3 |2 2 2 1 1 || - 【{Astronomia}】 + 銆恵Astronomia}銆 |4 4 4 4 6 6 6 6 |5 5 5 5 1' 1' 1' 1' |2' 2' 2' 2' 2' 2' 2' 2' |5 4 3 1 2 0 2 6 ||||||||||||| |5 0 4 0 3 0 3 3 |5 0 4 3 2 0 2 3' ||||2' 3' 2' 3' 2 0 2 3' ||||2' 3' 2' 3' 2 0 2 6 ||||||||| |5 0 4 0 3 0 3 3 |5 0 4 3 2 0 2 3' ||||2' 3' 2' 3' 2 0 2 3' ||||2' 3' 2' 3' 4 4 4 4 ||||||||| diff --git "a/\350\266\205\347\272\247\347\216\233\344\270\275/Mario.cpp" "b/\350\266\205\347\272\247\347\216\233\344\270\275/Mario.cpp" new file mode 100644 index 0000000..2b0befe --- /dev/null +++ "b/\350\266\205\347\272\247\347\216\233\344\270\275/Mario.cpp" @@ -0,0 +1,942 @@ +/*--------------------------------------------------------- +绋嬪簭锛 瓒呯骇鐜涗附缁忓吀鐗 锛堢函C璇█锛屽彲鐩存帴缂栬瘧鍣ㄨ繍琛岋級 +浣滆咃細 缁濅鸡N / 404name +璇存槑锛 +--1.鍏充簬鎿嶄綔--- +ad绉诲姩 +w鍘熷湴璺 +qe鏂滆烦 +鏂滆烦鍚屾椂鎸変綇绉诲姩閿疄鐜拌繙璺濈璺宠穬 +韫蹭笅鍜屽彂灏勫瓙寮规病鏈夊啓) +---------------------------------------------------------*/ +#include //getch() +#include +#include +#include +#include + +const int allPages = 14; +const int WIDTH = 300; +const int HEIGHT = 98; +// debug妯″紡锛岄粯璁よ瑙掗攣瀹氬间负1 +const int ifCameraClock = 1; +int action_Cnt = 0; //璁板綍琛屼负index +int nextGo[4][2] = {0, -1, -1, 0, 0, 1, 1, 0}; // awds; 宸﹀彸0 2 涓婁笅1 3 +int if_GameOver = 0; +int event_Change = 0; //澶栫晫浜嬩欢鏄惁鏀瑰彉锛屾敼鍙樺氨杩涘叆鍒ゆ柇鍑芥暟 +int oldMarioX; +int oldMarioY; +int cameraY = 0; +struct player { + int flag; //鍒嗚鲸杩欐槸浠涔 0椹噷濂 1铇戣弴 2鏄熸槦 3鏁屼汉铇戣弴 4鏁屼汉涔岄緹 + int turn; + int leftGoCnt; + int rightGocnt; + int if_Falling; //鏄惁澶勪簬绌轰腑 + int if_Action; // 鏄惁鍦ㄦ墽琛岃繛缁姩浣 骞舵槸瀵瑰簲鍔ㄤ綔鐨勪笅鏍 + int X; + int Y; + int Height; + int Width; + char Image[20][40]; +} +//椹噷濂 +Mario = {0, + 1, + 0, + 0, + 0, + -1, + HEIGHT - 18, + WIDTH / 3 - 50, + 8, + 18, + {" ########### ", " ################ ", " ########## ", + " ## # ", "#### ### ######## ", "##################", + " ### ### ", " ### ### "}}, + // 5涓晫浜鸿槕鑿囦綅缃 + Enemy_Mushroom[5] = + {{3, 0, 0, 0, 0, -1, HEIGHT - 18, WIDTH * 2 / 3, 8, 20, {""}}, + {3, 0, 0, 0, 0, -1, 0, 0, 8, 20, {""}}, + {3, 0, 0, 0, 0, -1, 0, 0, 8, 20, {""}}, + {3, 0, 0, 0, 0, -1, 0, 0, 8, 20, {""}}, + {3, 0, 0, 0, 0, -1, 0, 0, 8, 20, {""}}}, + // 3涓箤榫熶綅缃 + Enemy_Tortoise[3] = + {{4, 0, 0, 0, 0, -1, HEIGHT - 18, WIDTH * 2 / 3, 8, 20, {""}}, + {4, 0, 0, 0, 0, -1, 0, 0, 8, 20, {""}}, + {4, 0, 0, 0, 0, -1, 0, 0, 8, 20, {""}}}, + //鍙樺ぇ铇戣弴 + Mushroom = {1, 0, 0, 0, 0, -1, 0, 0, 8, 20, {""}}, + //鍙樺ぇ鏄熸槦 + Star = {2, 0, 0, 0, 0, -1, 0, 0, 8, 20, {""}}; + +int jump_Action[10][50] = {{16, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + {30, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 2, 2, 1, + 1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2}, + {30, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, + 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0}, + {5, 1, 1, 1, 1, 1}}; +char background[HEIGHT + 1][WIDTH * allPages + 1]; +char enemy_Mushroom[9][21]; //铇戣弴鏁屼汉 +char alive_Tortoise_LeftGo[9][21]; //涔岄緹鏁屼汉 +char alive_Tortoise_RightGo[9][21]; +char dead_Tortoise[9][21]; // 榫熷3 +char star[9][21]; //鏄熸槦 +char to_Big_Mushroom[9][21]; //鍙樺ぇ鍜 +char little_Mario_jump[9][19]; +char little_Mario_leftGo1[9][19]; +char little_Mario_leftGo2[9][19]; +char little_Mario_rightGo1[9][19]; +char little_Mario_rightGo2[9][19]; +char little_Mario_stand[9][19]; +char big_Mario_jump[16][21]; +char big_Mario_leftGo1[16][21]; +char big_Mario_leftGo2[16][21]; +char big_Mario_rightGo1[16][21]; +char big_Mario_rightGo2[16][21]; +char big_Mario_stand[16][21]; +void changePlayerTurn(int turn); +void printBackground(); +void printPlayer(); +void HideCursor() //鍏夋爣闅愯棌 +{ + CONSOLE_CURSOR_INFO cursor_info = {1, 0}; //鍚庤竟鐨0浠h〃鍏夋爣涓嶅彲瑙 + SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info); +} +void gotoxy(int x, int y) //璁╁厜鏍囩Щ鍔ㄥ埌鍧愭爣鍘绘墦鍗板唴瀹瑰嚱鏁 +{ + HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); + COORD pos; + pos.X = x; + pos.Y = y; + SetConsoleCursorPosition(handle, pos); +} +void initBackground() { + for (int i = 0; i < HEIGHT; i++) { + strcpy(background[i], "\0"); + } +} +void setColor(short x) //鑷畾涔夊嚱鏍规嵁鍙傛暟鏀瑰彉棰滆壊 +{ + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), x); +} +void getRoot(int pass, int page, char root[]) { + char fileRoot[100] = "pass/"; + char tempStr[10]; + sprintf(tempStr, "%d", pass); + strcat(fileRoot, tempStr); + strcat(fileRoot, "/page"); + sprintf(tempStr, "%d", page); + strcat(fileRoot, tempStr); + strcat(fileRoot, ".txt"); + strcpy(root, fileRoot); +} + +void loadAnimation() { + FILE* fp1 = fopen("animation/little_Mario_stand.txt", "r"); + FILE* fp2 = fopen("animation/little_Mario_leftGo1.txt", "r"); + FILE* fp3 = fopen("animation/little_Mario_leftGo2.txt", "r"); + FILE* fp4 = fopen("animation/little_Mario_rightGo1.txt", "r"); + FILE* fp5 = fopen("animation/little_Mario_rightGo2.txt", "r"); + FILE* fp6 = fopen("animation/little_Mario_jump.txt", "r"); + for (int i = 0; i < 8; i++) { + fgets(little_Mario_stand[i], sizeof(little_Mario_stand[i]) + 1, fp1); + fgets(little_Mario_leftGo1[i], sizeof(little_Mario_leftGo1[i]) + 1, + fp2); + fgets(little_Mario_leftGo2[i], sizeof(little_Mario_leftGo2[i]) + 1, + fp3); + fgets(little_Mario_rightGo1[i], sizeof(little_Mario_rightGo1[i]) + 1, + fp4); + fgets(little_Mario_rightGo2[i], sizeof(little_Mario_rightGo2[i]) + 1, + fp5); + fgets(little_Mario_jump[i], sizeof(little_Mario_jump[i]) + 1, fp6); + } + fclose(fp1); + fclose(fp2); + fclose(fp3); + fclose(fp4); + fclose(fp5); + fclose(fp6); + FILE* Fp1 = fopen("animation/big_Mario_stand.txt", "r"); + FILE* Fp2 = fopen("animation/big_Mario_leftGo1.txt", "r"); + FILE* Fp3 = fopen("animation/big_Mario_leftGo2.txt", "r"); + FILE* Fp4 = fopen("animation/big_Mario_rightGo1.txt", "r"); + FILE* Fp5 = fopen("animation/big_Mario_rightGo2.txt", "r"); + FILE* Fp6 = fopen("animation/big_Mario_jump.txt", "r"); + for (int i = 0; i < 16; i++) { + fgets(big_Mario_stand[i], sizeof(big_Mario_stand[i]) + 1, Fp1); + fgets(big_Mario_leftGo1[i], sizeof(big_Mario_leftGo1[i]) + 1, Fp2); + fgets(big_Mario_leftGo2[i], sizeof(big_Mario_leftGo2[i]) + 1, Fp3); + fgets(big_Mario_rightGo1[i], sizeof(big_Mario_rightGo1[i]) + 1, Fp4); + fgets(big_Mario_rightGo2[i], sizeof(big_Mario_rightGo2[i]) + 1, Fp5); + fgets(big_Mario_jump[i], sizeof(big_Mario_jump[i]) + 1, Fp6); + } + getchar(); + fclose(Fp1); + fclose(Fp2); + fclose(Fp3); + fclose(Fp4); + fclose(Fp5); + fclose(Fp6); + FILE* Fpp1 = fopen("animation/enemy_Mushroom.txt", "r"); + FILE* Fpp2 = fopen("animation/alive_Tortoise_leftGo.txt", "r"); + FILE* Fpp6 = fopen("animation/alive_Tortoise_rightGo.txt", "r"); + FILE* Fpp3 = fopen("animation/dead_Tortoise.txt", "r"); + FILE* Fpp4 = fopen("animation/star.txt", "r"); + FILE* Fpp5 = fopen("animation/to_Big_Mushroom.txt", "r"); + for (int i = 0; i < 16; i++) { + fgets(enemy_Mushroom[i], sizeof(enemy_Mushroom[i]) + 1, Fpp1); + fgets(alive_Tortoise_LeftGo[i], sizeof(alive_Tortoise_LeftGo[i]) + 1, + Fpp2); + fgets(alive_Tortoise_RightGo[i], sizeof(alive_Tortoise_RightGo[i]) + 1, + Fpp6); + fgets(dead_Tortoise[i], sizeof(dead_Tortoise[i]) + 1, Fpp3); + fgets(star[i], sizeof(star[i]) + 1, Fpp4); + fgets(to_Big_Mushroom[i], sizeof(to_Big_Mushroom[i]) + 1, Fpp5); + } + fclose(Fpp1); + fclose(Fpp2); + fclose(Fpp3); + fclose(Fpp4); + fclose(Fpp5); + fclose(Fpp6); +} + +void loadFile(int pass, int pages) { + initBackground(); + loadAnimation(); + for (int page = 0; page <= pages; page++) { + FILE* fp = NULL; //鎵撳紑璇诲啓鏂囦欢 + char fileRoot[100] = "\0"; + getRoot(pass, page, fileRoot); + fp = fopen(fileRoot, "r"); + char buf[1024]; + for (int i = 0; i < HEIGHT; i++) { + if (fgets(buf, sizeof(buf), fp) != NULL) { + strncat(background[i], buf, WIDTH); + // printf("%s\n",background[i]); + } else + break; + } + fclose(fp); + } +} +void gameOver() { + changePlayerTurn(0); + Mario.turn = 1; + Mario.X -= 30; + printBackground(); + printPlayer(); + Sleep(200); + while (Mario.X < HEIGHT) { + Mario.X += 1; + printBackground(); + printPlayer(); + } + Sleep(1000); + system("cls"); + printf("your are lose"); + getchar(); + getchar(); + Mario.turn = 1; + Mario.X = HEIGHT * 2 / 3; +} +void changeTortoiseTurn(player* object, int turn) { + if (turn == 1) { + for (int i = 0; i < Star.Height; i++) { + strcpy((*object).Image[i], alive_Tortoise_LeftGo[i]); + (*object).Image[i][(*object).Width] = '\0'; + } + } else if (turn == 2) { + for (int i = 0; i < Star.Height; i++) { + strcpy((*object).Image[i], alive_Tortoise_RightGo[i]); + (*object).Image[i][(*object).Width] = '\0'; + } + } else if (turn == 3) { + for (int i = 0; i < Star.Height; i++) { + strcpy((*object).Image[i], dead_Tortoise[i]); + (*object).Image[i][(*object).Width] = '\0'; + } + } +} +void printBackground() { + int startPrintY = Mario.Y - WIDTH / 3; + //瑙嗚鍥哄畾 + if (ifCameraClock == 1 && startPrintY < cameraY) { + startPrintY = cameraY; + } + //瑙嗚璺熼殢椹噷濂ュ墠绉 鍚屾椂妫娴嬪唴瀹 + else { + cameraY = startPrintY; + for (int i = 0; i < HEIGHT; i++) { + for (int k = 0; k < 4; k++) { + if (background[i][cameraY + WIDTH + k] == '3') { //鐢熸垚鏁屼汉铇戣弴 + background[i][cameraY + WIDTH + k] = ' '; //娓呯┖ + for (int j = 0; j < 5; j++) { + if (Enemy_Mushroom[j].turn == 0) { + Enemy_Mushroom[j].turn = 1; + Enemy_Mushroom[j].X = i; + + Enemy_Mushroom[j].Y = cameraY + WIDTH - 1 - + Enemy_Mushroom[j].Width + k; + break; + } + } + } else if (background[i][cameraY + WIDTH + k] == + '4') { //鐢熸垚鏁屼汉涔岄緹 + background[i][cameraY + WIDTH + k] = ' '; + for (int j = 0; j < 3; j++) { + if (Enemy_Tortoise[j].turn == 0) { + Enemy_Tortoise[j].turn = 1; + changeTortoiseTurn(&Enemy_Tortoise[j], 1); + Enemy_Tortoise[j].X = i; + + Enemy_Tortoise[j].Y = cameraY + WIDTH - 1 - + Enemy_Tortoise[j].Width + k; + break; + } + } + } + } + } + } + gotoxy(0, 0); + char tempStr[WIDTH + 1]; + for (int i = 0; i < HEIGHT; i++) { + strncpy(tempStr, background[i] + startPrintY, WIDTH); + tempStr[WIDTH] = '\0'; + printf("%s\n", tempStr); + } +} + +void changePlayerTurn(int flag) { + if (flag < 6) { + Mario.Height = 8; + Mario.Width = 18; + for (int i = 0; i < Mario.Height; i++) { + if (flag == 0) + strcpy(Mario.Image[i], little_Mario_stand[i]); + else if (flag == 1) + strcpy(Mario.Image[i], little_Mario_jump[i]); + else if (flag == 2) + strcpy(Mario.Image[i], little_Mario_rightGo1[i]); + else if (flag == 3) + strcpy(Mario.Image[i], little_Mario_rightGo2[i]); + else if (flag == 4) + strcpy(Mario.Image[i], little_Mario_leftGo1[i]); + else if (flag == 5) + strcpy(Mario.Image[i], little_Mario_leftGo2[i]); + Mario.Image[i][Mario.Width] = '\0'; + } + } else if (flag < 12) { + Mario.Height = 16; + Mario.Width = 20; + for (int i = 0; i < Mario.Height; i++) { + if (flag == 6) + strcpy(Mario.Image[i], big_Mario_stand[i]); + else if (flag == 7) + strcpy(Mario.Image[i], big_Mario_jump[i]); + else if (flag == 8) + strcpy(Mario.Image[i], big_Mario_rightGo1[i]); + else if (flag == 9) + strcpy(Mario.Image[i], big_Mario_rightGo2[i]); + else if (flag == 10) + strcpy(Mario.Image[i], big_Mario_leftGo1[i]); + else if (flag == 11) + strcpy(Mario.Image[i], big_Mario_leftGo2[i]); + Mario.Image[i][Mario.Width] = '\0'; + } + } +} +void printObject(player object) { + char tempStr[object.Width + 1]; + /*for(int i = 0; i < Mario.Height; i++){ + strncpy(tempStr,background[oldMarioX - Mario.Height + i] + + oldMarioY,Mario.Width); gotoxy(oldMarioY - cameraY,oldMarioX - Mario.Height + + i); tempStr[Mario.Width] = '\0'; printf("%s",tempStr); + }*/ + setColor(3); + //鎵撳嵃鏂扮殑 + for (int i = 0; i < object.Height; i++) { + if (object.X - object.Height + i > 0) + gotoxy(object.Y - cameraY, object.X - object.Height + i); + printf("%s", object.Image[i]); + setColor(7); + for (int j = 0; j < object.Width; j++) { + if (object.Image[i][j] == ' ' && object.X - object.Height + i > 0) { + gotoxy(object.Y - cameraY + j, object.X - object.Height + i); + printf("%c", + background[object.X - object.Height + i][object.Y + j]); + } + } + setColor(3); + } + setColor(7); +} +//鏌ヨ鎵鏈塧ctive鐨刾layer鎵撳嵃 +void printPlayer() { + if (Star.turn != 0) { + printObject(Star); + } + if (Mushroom.turn != 0) { + printObject(Mushroom); + } + //鎵撳嵃鏁屼汉铇戣弴 + for (int j = 0; j < 5; j++) { + if (Enemy_Mushroom[j].turn != 0) { + printObject(Enemy_Mushroom[j]); + } + } + //鎵撳嵃鏁屼汉涔岄緹 + for (int j = 0; j < 3; j++) { + if (Enemy_Tortoise[j].turn != 0) { + printObject(Enemy_Tortoise[j]); + } + } + //鎵撳嵃椹噷濂 + if (Mario.turn != 0) { + printObject(Mario); + oldMarioX = Mario.X; + oldMarioY = Mario.Y; + } +} +void delete_Block(int x, int y) { + int startx, starty, endx, endy; + while (background[x - 1][y] != '#' || background[x - 1][y + 1] == '#') { + y--; + } + endx = x, starty = y; + x--; + while (background[x][y + 1] != '#') { + x--; + } + y++; + while (background[x + 1][y] != '#') { + y++; + } + startx = x, endy = y; + char change_Block = ' '; + //鐮栧潡鍥村 ackground[startx+1][starty+1] + //鏄疢琛ㄧず鍙樻垚澧欙紝鏄┖鏍艰〃绀烘槸鍙樺ぇ锛屾槸O琛ㄧず鏄《瀹屾秷澶 + if (background[startx + 1][starty + 1] == 'M') + change_Block = 'M'; + else if (background[startx + 1][starty + 1] == 'O' && Mario.turn == 1) + return; //灏忛┈閲屽ゥ涓嶈兘椤剁爾鍧 ) + else if (background[startx + 1][starty + 1] == '1') { + Mushroom.turn = 2; + Mushroom.X = startx - 1; + Mushroom.Y = starty; + change_Block = 'M'; + } else if (background[startx + 1][starty + 1] == '2') { + Star.turn = 2; + Star.X = startx - 1; + Star.Y = starty; + change_Block = 'M'; + } + for (int i = startx; i <= endx; i++) { + for (int j = starty; j <= endy; j++) { + background[i][j] = change_Block; + if (change_Block == ' ' && + (i == startx || i == endx || j == starty || j == endy) && + rand() % 4 == 0) { + int index = rand() % 4; + if (background[i + nextGo[index][0]][j + nextGo[index][1]] == + ' ') + background[i + nextGo[index][0]][j + nextGo[index][1]] = + 'o'; + } + } + } +} +int isInterset(player a, player b) { + if (b.Y > a.Y + a.Width || a.X < b.X - b.Height || b.X < a.X - a.Height || + a.Y > b.Y + b.Width) + return 0; + else { + if (a.flag == 0 && + (a.X == b.X - b.Height)) { //椹噷濂ョ鎾炰笖鏄線涓嬪帇 鍒欐秷鐏 + return 2; + } + return 1; + } +} +//妫娴嬬姸鎬 +int checkInput(player* object, int turn) { + if ((*object).flag != 0 && (*object).Y - cameraY <= 1) { + (*object).turn = 0; + printBackground(); + printPlayer(); + return 0; + } + if (turn == 'a' || turn == 0) { + if (Mario.Y - cameraY <= 1) { + (*object).if_Action = -1; + return 0; + } + for (int i = 0; i < (*object).Height; i++) { + if (background[(*object).X - (*object).Height + i] + [(*object).Y - 1] == 'M' || + background[(*object).X - (*object).Height + i] + [(*object).Y - 1] == '#') { + (*object).if_Action = -1; + if ((*object).flag != 0) { + if ((*object).turn == 1) { + (*object).turn = 2; + if ((*object).flag == 4) { + changeTortoiseTurn(object, 2); + } + } else { + (*object).turn = 1; + if ((*object).flag == 4) { + changeTortoiseTurn(object, 1); + } + } + } + return 0; + } + } + } else if (turn == 'd' || turn == 2) { + if ((*object).Y + (*object).Width - cameraY >= WIDTH) { + if ((*object).flag != 0) { + if ((*object).turn == 1) + (*object).turn = 2; + else + (*object).turn = 1; + } + return 0; + } + for (int i = 0; i < (*object).Height; i++) { + if (background[(*object).X - (*object).Height + i] + [(*object).Y + (*object).Width] == 'M' || + background[(*object).X - (*object).Height + i] + [(*object).Y + (*object).Width] == '#') { + (*object).if_Action = -1; + if ((*object).flag != 0) { + if ((*object).turn == 1) { + (*object).turn = 2; + if ((*object).flag == 4) { + changeTortoiseTurn(object, 2); + } + } else { + (*object).turn = 1; + if ((*object).flag == 4) { + changeTortoiseTurn(object, 1); + } + } + } + return 0; + } + } + } else if (turn == 'w' || turn == 1) { + if ((*object).if_Action == -1 && (*object).if_Falling == 1) + return 0; + if (turn == 'w' && + ((*object).if_Action != -1 || (*object).if_Falling == 1)) + return 0; + if ((*object).X - (*object).Height < 1) { + return 0; + } + for (int i = 0; i < (*object).Width; i++) { + if ((*object).X - (*object).Height - 1 > 0 && + background[(*object).X - (*object).Height - 1] + [(*object).Y + i] == '#') { + //鍒犻櫎椤舵挒鐮栧潡 + delete_Block((*object).X - (*object).Height - 1, + (*object).Y + i); + return 0; + } else if ((*object).X - (*object).Height - 1 > 0 && + background[(*object).X - (*object).Height - 2] + [(*object).Y + i] == '#') { + //鍒犻櫎椤舵挒鐮栧潡 + delete_Block((*object).X - (*object).Height - 2, + (*object).Y + i); + return 0; + } else if ((*object).X - (*object).Height - 1 > 0 && + background[(*object).X - (*object).Height - 1] + [(*object).Y + i] == 'M') { + (*object).if_Action = -1; + return 0; + } + } + } else if (turn == 'e' || turn == 'q') { + if ((*object).if_Action != -1 || (*object).if_Falling == 1) { + return 0; + } + } + //闈為┈閲屽ゥ 涓斿拰鐗╁搧纰版挒 + int intersetFlag = isInterset(Mario, (*object)); + if ((*object).flag != 0 && intersetFlag) { + if ((*object).flag == 1) { //鍙樺ぇ铇戣弴 + (*object).turn = 0; + Mario.turn = 2; + changePlayerTurn(6); + printBackground(); + printPlayer(); + } else if ((*object).flag == 2) { + (*object).turn = 0; + Mario.turn = 2; + changePlayerTurn(6); + printBackground(); + printPlayer(); + + } else if ((*object).flag == 3 || + (*object).flag == 4) { //纰板埌鏁屼汉鎵g敓鍛 + if (intersetFlag == 1) { + Mario.turn--; + if (Mario.turn == 1) { + changePlayerTurn(0); + } else { + gameOver(); + } + } else if (intersetFlag == 2) { + if ((*object).flag == 4) { + if ((*object).turn != 3) { + (*object).turn = 3; + changeTortoiseTurn(object, 3); + Mario.X--; + } else { + (*object).turn = 0; + } + } else + (*object).turn = 0; + Mario.if_Action = 3; + action_Cnt = 0; + printBackground(); + printPlayer(); + } + } + return 0; + } else if ((*object).flag == 0) { //椹噷濂ュ姩 + if (Mushroom.turn != 0 && isInterset(Mario, Mushroom)) { //鍚冨埌铇戣弴 + Mushroom.turn = 0; + Mario.turn = 2; + changePlayerTurn(6); + return 0; + } + if (Star.turn != 0 && isInterset(Mario, Star)) { //鍚冨埌鏄熸槦 + Star.turn = 0; + Mario.turn = 2; + changePlayerTurn(6); + return 0; + } + for (int i = 0; i < 5; i++) { + if (Enemy_Mushroom[i].turn != 0 && + isInterset(Mario, Enemy_Mushroom[i])) { + if (isInterset(Mario, Enemy_Mushroom[i]) == 1) { + Mario.turn--; + if (Mario.turn == 1) { + changePlayerTurn(0); + } else { + gameOver(); + } + } else if (isInterset(Mario, Enemy_Mushroom[i]) == 2) { + Enemy_Mushroom[i].turn = 0; + Mario.if_Action = 3; + action_Cnt = 0; + printBackground(); + printPlayer(); + } + } + } + for (int i = 0; i < 3; i++) { + if (Enemy_Tortoise[i].turn != 0 && + isInterset(Mario, Enemy_Tortoise[i])) { + if (isInterset(Mario, Enemy_Tortoise[i]) == 1) { + Mario.turn--; + if (Mario.turn == 1) { + changePlayerTurn(0); + } else { + gameOver(); + } + } else if (isInterset(Mario, Enemy_Tortoise[i]) == 2) { + if (Enemy_Tortoise[i].turn != 3) { + Enemy_Tortoise[i].turn = 3; + changeTortoiseTurn(&Enemy_Tortoise[i], 3); + Mario.X--; + } else + Enemy_Tortoise[i].turn = 0; + Mario.if_Action = 3; + action_Cnt = 0; + printBackground(); + printPlayer(); + } + } + } + } + return 1; +} +//鍒ゆ柇涓嬪潬 +void checkFalling(player* object) { + if ((*object).flag != 0 && (*object).Y - cameraY <= 1) { + (*object).turn = 0; + return; + } + if ((*object).flag == 0) + event_Change = 0; + if (Mario.X == HEIGHT - 1) { + gameOver(); + return; + } + if ((*object).X == HEIGHT - 1) { + (*object).turn = 0; + printBackground(); + printPlayer(); + } + for (int i = 0; i < (*object).Width; i++) { + if ((*object).X > 0 && + background[(*object).X][(*object).Y + i] == 'M' || + background[(*object).X][(*object).Y + i] == '#') { + (*object).if_Falling = 0; + return; + } + } + (*object).if_Falling = 1; + if ((*object).X - (*object).Height > 0) { + gotoxy((*object).Y - cameraY, (*object).X - (*object).Height); + for (int i = 0; i < (*object).Width; i++) { + printf("%c", + background[(*object).X - (*object).Height][(*object).Y + i]); + } + } + (*object).X++; + printObject((*object)); //鍚戜笅 + if ((*object).flag == 0) { + oldMarioX = Mario.X; + oldMarioY = Mario.Y; + } + checkInput(object, 'z'); +} +void objectGo(player* object) { + int forword = 0; + if ((*object).turn == 0) + return; + if ((*object).turn == 1) + forword = 0; + else if ((*object).turn == 2) + forword = 2; + else if ((*object).turn == 3) { + printObject((*object)); + return; + } + if (checkInput(object, forword)) { + (*object).X += nextGo[forword][0]; + (*object).Y += nextGo[forword][1]; + // c鎿﹂櫎鍙宠竟 + /*gotoxy((*object).Y - cameraY, (*object).X - (*object).Height); + for (int i = 0; i < (*object).Width; i++) { + printf("%c", + background[(*object).X - (*object).Height][(*object).Y + i]); + }*/ + if (forword == 0) { + for (int i = 0; i < (*object).Height; i++) { + gotoxy((*object).Y - cameraY + (*object).Width, + (*object).X - (*object).Height + i); + printf("%c", background[(*object).X - (*object).Height + i] + [(*object).Y + (*object).Width]); + } + } else if (forword == 2) { // c鎿﹂櫎宸﹁竟 + for (int i = 0; i < (*object).Height; i++) { + gotoxy((*object).Y - cameraY - 1, + (*object).X - (*object).Height + i); + printf("%c", background[(*object).X - (*object).Height + i] + [(*object).Y - 1]); + } + } + printObject((*object)); + } +} +void checkObjectGo() { + if (Mushroom.turn != 0) { + checkFalling(&Mushroom); + if (!Mushroom.if_Falling) { + objectGo(&Mushroom); + } + } + if (Star.turn != 0) { + checkFalling(&Star); + if (!Star.if_Falling) { + objectGo(&Star); + } + } + for (int i = 0; i < 5; i++) { + if (Enemy_Mushroom[i].turn != 0) { + checkFalling(&Enemy_Mushroom[i]); + if (!Enemy_Mushroom[i].if_Falling) { + objectGo(&Enemy_Mushroom[i]); + } + } + } + for (int i = 0; i < 3; i++) { + if (Enemy_Tortoise[i].turn != 0) { + checkFalling(&Enemy_Tortoise[i]); + if (!Enemy_Tortoise[i].if_Falling) { + objectGo(&Enemy_Tortoise[i]); + } + } + } +} +void autoChange() { + static int delayTime = 1000; + if (Mario.if_Action != -1) { //鎵ц璺宠穬鍔ㄤ綔鐨勬椂鍊欎笉鑷姩涓嬪潬 + action_Cnt++; + if (Mario.if_Action == 0) { + while (checkInput(&Mario, + jump_Action[Mario.if_Action][action_Cnt]) != 0 && + action_Cnt <= jump_Action[Mario.if_Action][0] && + Mario.X - Mario.Height > 0) { + oldMarioX = Mario.X; + oldMarioY = Mario.Y; + Mario.X += + 2 * nextGo[jump_Action[Mario.if_Action][action_Cnt]][0]; + Mario.Y += nextGo[jump_Action[Mario.if_Action][action_Cnt]][1]; + action_Cnt++; + } + printBackground(); + printPlayer(); + action_Cnt = 0; + Mario.if_Action = -1; + Mario.if_Falling = 1; + } else { + if (action_Cnt > jump_Action[Mario.if_Action][0]) { + action_Cnt = 0; + Mario.if_Action = -1; + Mario.if_Falling = 1; + } else if (checkInput(&Mario, + jump_Action[Mario.if_Action][action_Cnt]) == + 0) { + action_Cnt = 0; + Mario.if_Action = -1; + Mario.if_Falling = 1; + } else { + int cnt = 5; + while (cnt-- && + checkInput(&Mario, + jump_Action[Mario.if_Action][action_Cnt]) != + 0 && + action_Cnt <= jump_Action[Mario.if_Action][0] && + Mario.X - Mario.Height > 0) { + oldMarioX = Mario.X; + oldMarioY = Mario.Y; + Mario.X += + 2 * nextGo[jump_Action[Mario.if_Action][action_Cnt]][0]; + Mario.Y += + 2 * nextGo[jump_Action[Mario.if_Action][action_Cnt]][1]; + action_Cnt++; + } + printBackground(); + printPlayer(); + } + } + checkObjectGo(); + } else if (event_Change || Mario.if_Falling) { + checkFalling(&Mario); + checkObjectGo(); + delayTime = 500; + } + delayTime--; + if (!delayTime) { + delayTime = 500; + checkObjectGo(); + } + //鏌ョ湅鍏朵粬object鐘舵 +} +void manChange() { + static int rightGo = 0; + static int leftGo = 0; + if (kbhit()) { + HideCursor(); + char temp = getch(); + if (checkInput(&Mario, temp) == 0) + return; + event_Change = 1; + if (temp == 'd' || temp == 'D') { + Mario.rightGocnt++; + if (Mario.turn == 1) { //灏忓舰鎬 + if (Mario.rightGocnt % 2 == 0) + changePlayerTurn(2); + else + changePlayerTurn(3); + } else if (Mario.turn == 2) { //澶у舰鎬 + if (Mario.rightGocnt % 2 == 0) + changePlayerTurn(8); + else + changePlayerTurn(9); + } + Mario.Y += 4; + } else if (temp == 'a' || temp == 'A') { + Mario.leftGoCnt++; + if (Mario.turn == 1) { //灏忓舰鎬 + if (Mario.leftGoCnt % 2 == 0) + changePlayerTurn(4); + else + changePlayerTurn(5); + } else if (Mario.turn == 2) { //澶у舰鎬 + if (Mario.leftGoCnt % 2 == 0) + changePlayerTurn(10); + else + changePlayerTurn(11); + } + Mario.Y -= 4; + } else if (temp == 'w') { + Mario.if_Action = 0; + /*if(Mario.X - 21 - Mario.Height > 0) + Mario.X -= 21;*/ + } else if (temp == 'e' || temp == 'E') { + Mario.if_Action = 1; + + } else if (temp == 'q' || temp == 'Q') { + Mario.if_Action = 2; + + } else if (temp == 'o') { + Mario.turn = 1; + changePlayerTurn(0); + } else if (temp == 'p') { + Mario.turn = 2; + changePlayerTurn(6); + } else if (temp == 'z') { + changePlayerTurn(8); + } else if (temp == 'x') { + changePlayerTurn(9); + } else if (temp == 'c') { + changePlayerTurn(10); + } else if (temp == 'v') { + changePlayerTurn(11); + } + printBackground(); + printPlayer(); + checkObjectGo(); + } +} + +void initGame() { + HideCursor(); + oldMarioX = Mario.X; + oldMarioY = Mario.Y; + loadFile(1, 13); //鍔犺浇鏂囦欢 + //鍒涘缓濂芥晫浜洪鍒朵綋5涓+2涓 + for (int i = 0; i < Star.Height; i++) { + for (int j = 0; j < 5; j++) { + strcpy(Enemy_Mushroom[j].Image[i], enemy_Mushroom[i]); + Enemy_Mushroom[j].Image[i][Enemy_Mushroom[j].Width] = '\0'; + } + for (int j = 0; j < 3; j++) { + strcpy(Enemy_Tortoise[j].Image[i], alive_Tortoise_LeftGo[i]); + Enemy_Tortoise[j].Image[i][Enemy_Tortoise[j].Width] = '\0'; + } + strcpy(Star.Image[i], star[i]); + Star.Image[i][Star.Width] = '\0'; + strcpy(Mushroom.Image[i], to_Big_Mushroom[i]); + Mushroom.Image[i][Mushroom.Width] = '\0'; + } + getchar(); + printBackground(); +} +int main() { + initGame(); + while (1) { + manChange(); + autoChange(); + } + return 0; +} diff --git "a/\350\266\205\347\272\247\347\216\233\344\270\275/\350\266\205\347\272\247\347\216\233\344\270\275\346\211\223\345\214\205.rar" "b/\350\266\205\347\272\247\347\216\233\344\270\275/\350\266\205\347\272\247\347\216\233\344\270\275\346\211\223\345\214\205.rar" index c4cde28..5c00e30 100644 Binary files "a/\350\266\205\347\272\247\347\216\233\344\270\275/\350\266\205\347\272\247\347\216\233\344\270\275\346\211\223\345\214\205.rar" and "b/\350\266\205\347\272\247\347\216\233\344\270\275/\350\266\205\347\272\247\347\216\233\344\270\275\346\211\223\345\214\205.rar" differ