版本比较
草原战争(双人)
正文
增加 21 行删除 21 行
1234456787 行未改动16171819202021222324252627282930313233342324252627282930313233343536363738394014 行未改动5556575859596061626339 行未改动103104105106107107108109110111102 行未改动全部展开214215216217218218219220221222223224225226227227228229230231232233233234235236237238239240241242242243244245246160 行未改动全部展开- 草原战争(双人)```//感觉解释不全,很难玩#include <bits/stdc++.h> //WEWILLFINDYOUANDHANTYOU #include <bits/stdc++.h> //WEWILLFINDYOUANDHANTYOU#include <windows.h> //GETYOUANDKILLYOUEATYOU!#include <conio.h>using namespace std;int t,g[15][15],h;7 行未改动void col(int c1,int c2,string c){ SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), c1*16+c2); cout<<c;} void HideCursor(){ CONSOLE_CURSOR_INFO cursor_info = {1, 0}; CONSOLE_CURSOR_INFO cursor_info = {1, 0}; SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);} int makeg(int k){ if(k<=600) return 0;//荒原 if(k<=690) return 1;//草地 if(k<=780) return 2;//沼泽 if(k<=870) return 3;//冰川 if(k<=980) return 4;//废墟 if(k<=986) return 5;//小炮 if(k<=988) return 6;//大炮 if(k<=991) return 7;//穿透枪 if(k<=992) return 8;// 弹炮 if(k<=997) return 9;//火矢 if(k<=999) return 10;//脉冲枪 if(k<=1000) return 11;//手榴弹 if(k<=600) return 0;//荒原 if(k<=690) return 1;//草地 if(k<=780) return 2;//沼泽 if(k<=870) return 3;//冰川 if(k<=980) return 4;//废墟 if(k<=986) return 5;//小炮 if(k<=988) return 6;//大炮 if(k<=991) return 7;//穿透枪 if(k<=992) return 8;// 弹炮 if(k<=997) return 9;//火矢 if(k<=999) return 10;//脉冲枪 if(k<=1000) return 11;//手榴弹} void make(){ int i=14,j; int i=14,j; col(cd,7,""); while(i--) cout<<st; cout<<endl; for(i=1;i<=12;i++){14 行未改动 else if(g[i][j]==5) col(cd,10,"="); else col(cd,7," "); } col(cd,7,st); cout<<endl; } i=14; } i=14; col(cd,7,""); while(i--) cout<<st; cout<<endl<<endl; col(10,0,"");39 行未改动 system("cls"); for(int i=1;i<=12;i++) for(int j=1;j<=12;j++) for(int k=1;k<=12;k++) for(int l=1;l<=12;l++) for(int l=1;l<=12;l++) dp[i][j][k][l]=-1; for(int i=1;i<=12;i++) for(int j=1;j<=12;j++) g[i][j]=makeg(rand()%1000+1);102 行未改动全部展开 col(cd,11,"▓"); col(cd,7,""); Sleep(30); cout<<endl; cout<<"按s键开始游戏\n按0键结束游戏"<<endl; cout<<"按s键开始游戏\n按0键结束游戏"<<endl; t=getch(); while(t!='s') t=getch(); system("cls"); make(); col(cd,12,"\n Game will start on 3 s\b\b"); for(int i=3;i>=1;i--){ Sleep(1000); cout<<"\b"<<i; } cout<<"开始!"<<endl; } cout<<"开始!"<<endl; system("cls"); make(); t=getch(); while(t!='0'){ bl=1; if(t=='w'&&xf>1&&(g[xf-1][yf]==0||g[xf-1][yf]==1)&&!((xf-1==xs)&&(yf==ys))){ if(t=='w'&&xf>1&&(g[xf-1][yf]==0||g[xf-1][yf]==1)&&!((xf-1==xs)&&(yf==ys))){ xf--; ff=0; } else if(t=='w'&&xf>1&&g[xf-1][yf]==2&&!((xf-1==xs)&&(yf==ys))){ xf--; hf--; ff=0; if(hf<=0) break; } else if(t=='w'&&xf>1&&g[xf-1][yf]>4&&!((xf-1==xs)&&(yf==ys))){ xf--; ff=0; gf=g[xf][yf]; g[xf][yf]=0; } else if(t=='s'&&xf<12&&(g[xf+1][yf]==0||g[xf+1][yf]==1)&&!((xf+1==xs)&&(yf==ys))){ } else if(t=='s'&&xf<12&&(g[xf+1][yf]==0||g[xf+1][yf]==1)&&!((xf+1==xs)&&(yf==ys))){ xf++; ff=1; } else if(t=='s'&&xf<12&&g[xf+1][yf]==2&&!((xf+1==xs)&&(yf==ys))){ xf++; hf--; ff=1; if(hf<=0) break;160 行未改动全部展开