版本比较
我的代码
正文
增加 14 行删除 14 行
123456721 行未改动293031323334353637290 行未改动全部展开32832933033133233333433533695 行未改动43243343443543643743843944044144244344444544644744844945034 行未改动4854864874884894904914924934944 行未改动499500501502503504505506507508509510511512513514515516517518519520521522523524525526527138 行未改动全部展开6666676686696706716726736744 行未改动关于C++,在编译时,可打开工具(tool)的第一个选项,在连接器命令行加入以下指令以减小exe文件的大小(命令间以空格隔开)。> `-O3`:最高级代码优化(删除冗余指令、循环展开等);> `-s`:移除符号表和调试信息;> `-ffunction-sections -fdata-sections -Wl,--gc-sections`:删除未调用的函数和数据段(“死代码消除”)。### 猜数```cpp#include <stdlib.h>21 行未改动}x=read();}printf("%d次猜对了!",num);Sleep(2000);return 0;}```### 代码佛290 行未改动全部展开hOutput=GetStdHandle(STD_OUTPUT_HANDLE);SetConsoleCursorPosition(hOutput,loc);}void CursorSetup(){CONSOLE_CURSOR_INFO cursor_info={1,0};SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cursor_info);}long long quickpow(long long a,long long b,long long p){long long ans=1,base=a;95 行未改动if(phole>4)phole-=4;}else if(rand()%9==8){if(phole<12)phole+=4;}}for(int j=1;j<=15;j++){world[21][j]=wall;if(abs(j-phole)<=lhole)world[21][j]=air;}world[21][phole]=bug;}else{for(int j=1;j<=15;j++){world[21][j]=air;}}}void update(){for(int i=2;i<=21;i++){for(int j=1;j<=15;j++){34 行未改动}int main(){srand(time(0));system("mode con cols=30 lines=15");CONSOLE_CURSOR_INFO cursor_info={1,0};SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cursor_info);cout << " JUMP INFINITY\n press any key to continue...\n\n\n\n\n\n made by @sky_of_stars";while(!kbhit());system("mode con cols=90 lines=30");while(1){4 行未改动frame++;if(frame>10000){frame=0;}spawn();update();screenupdate();if(frame%2==0)trymove();if(world[playerX][playerY]==wall || world[playerX][playerY]==bullet){Sleep(1000);maxscore=max(maxscore,score);cls();cout << " you died!\n\n User fell from a high place\n";cout << " score:" << score;cout << "\n maxscore:" << maxscore;BColor("BLACK");Sleep(3000);cls();break;}if(world[playerX][playerY]==bug){score+=10;}score+=5;Sleep(50);}}}138 行未改动全部展开if(solve(ans)!=24){printf("再想想\n正确答案是:");}else{printf("对了!");}}Sleep(1000);}Sleep(2000);4 行未改动123456721 行未改动293031323334353637290 行未改动全部展开32832933033133233333433533695 行未改动43243343443543643743843944044144244344444544644744844945034 行未改动4854864874884894904914924934944 行未改动499500501502503504505506507508509510511512513514515516517518519520521522523524525526527138 行未改动全部展开6666676686696706716726736744 行未改动关于C++,在编译时,可打开工具(tool)的第一个选项,在连接器命令行加入以下指令以减小exe文件的大小(命令间以空格隔开)。> `-O3`:最高级代码优化(删除冗余指令、循环展开等);> `-s`:移除符号表和调试信息;> `-ffunction-sections -fdata-sections -Wl,--gc-sections`:删除未调用的函数和数据段(“死代码消除”)。### 猜数```cpp#include <stdlib.h>21 行未改动}x=read();}printf("%d次猜对了!",num);Sleep(2000);return 0;}```### 代码佛290 行未改动全部展开hOutput=GetStdHandle(STD_OUTPUT_HANDLE);SetConsoleCursorPosition(hOutput,loc);}void CursorSetup(){CONSOLE_CURSOR_INFO cursor_info={1,0};SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cursor_info);}long long quickpow(long long a,long long b,long long p){long long ans=1,base=a;95 行未改动if(phole>4)phole-=4;}else if(rand()%9==8){if(phole<12)phole+=4;}}for(int j=1;j<=15;j++){world[21][j]=wall;if(abs(j-phole)<=lhole)world[21][j]=air;}world[21][phole]=bug;}else{for(int j=1;j<=15;j++){world[21][j]=air;}}}void update(){for(int i=2;i<=21;i++){for(int j=1;j<=15;j++){34 行未改动}int main(){srand(time(0));system("mode con cols=30 lines=15");CONSOLE_CURSOR_INFO cursor_info={1,0};SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cursor_info);cout << " JUMP INFINITY\n press any key to continue...\n\n\n\n\n\n made by @sky_of_stars";while(!kbhit());system("mode con cols=90 lines=30");while(1){4 行未改动frame++;if(frame>10000){frame=0;}spawn();update();screenupdate();if(frame%2==0)trymove();if(world[playerX][playerY]==wall || world[playerX][playerY]==bullet){Sleep(1000);maxscore=max(maxscore,score);cls();cout << " you died!\n\n User fell from a high place\n";cout << " score:" << score;cout << "\n maxscore:" << maxscore;BColor("BLACK");Sleep(3000);cls();break;}if(world[playerX][playerY]==bug){score+=10;}score+=5;Sleep(50);}}}138 行未改动全部展开if(solve(ans)!=24){printf("再想想\n正确答案是:");}else{printf("对了!");}}Sleep(1000);}Sleep(2000);4 行未改动