版本比较
CODE
正文
增加 70 行删除 70 行
371 行未改动全部展开37237337437537637737837937637737837938038138238238338438538633 行未改动4204214224234244244254264274283 行未改动4324334344354364364374384394406 行未改动44744844945045145145245345445581 行未改动53753853954054154154254354454522 行未改动568569570571572572573574575576181 行未改动全部展开75875976076176276276376476576676776876876977077177277177277377477577677777577677777877978078178278078178278378478478578678678778878979079178878979079179279379379479579679721 行未改动81982082182282382382482582682734 行未改动86286386486586686686786886987017 行未改动88888989089189289289389489589689789789889990090190290390490590690790890990690790890991091191291362 行未改动9769779789799809809819829839848 行未改动993994995996997997998999100010016 行未改动100810091010101110121012101310141015101668 行未改动1085108610871088108910891090109110921093321 行未改动全部展开141514161417141814191420141914201421142214231424142514231424142514261427142814291430142814291430143114321432143314341434143514361437143814391436143714381439144014411441144214431444144542 行未改动148814891490149114921492149314941495149619 行未改动15161517151815191520152015211522152315241525152615271527152815291530153118 行未改动1550155115521553155415551556155715541555155615571558155915601561565 行未改动全部展开212721282129213021312131213221332134213524 行未改动2160216121622163216421642165216621672168170 行未改动全部展开233923402341234223432343234423452346234760 行未改动240824092410241124122412241324142415241699 行未改动251625172518251925202520252125222523252423 行未改动254825492550255125522552255325542555255625 行未改动25822583258425852586258625872588258825892590259125922593259425952595259625972598259943 行未改动371 行未改动全部展开//last change:2024/08/05 21:00:51```## BBQ 2.0```cpp#include<bits/stdc++.h> #include<iomanip> #include<Windows.h> #include<conio.h> #include<bits/stdc++.h>#include<iomanip>#include<Windows.h>#include<conio.h>#include<random>using namespace std;//htu //htuconstexpr int v[7] = { 1,2,4,8,16,32,64 };struct peo { int qi; bool die; int typ;33 行未改动 for (int i = 0; i < str.size(); ++i) tmp += (int)str[i]; return tmp & 1;}//just for encryption //just for encryptioninline void setpos(int x = 0, int y = 0) { static COORD pos; pos.X = x; pos.Y = y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);}3 行未改动 for (int j = x1; j <= x2; j++) cout << ' '; }}//set output pos and clear a part //set output pos and clear a partinline int stdd(ifstream& ist) { setpos(); int tmpl, tmpv; string tps; ist >> tmpl; cout << tmpl; for (int i = 1; i <= tmpl - 10; ++i) ist >> tmpv >> tps;6 行未改动 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); } return min(tmpl, 10);}//each time game start output //each time game start outputinline int rndc(int qi) { int tmp = 0, ttl; if (!qi) return 0; for (int i = 1; i <= qi; ++i) tmp += i; mt19937 mt(rand()); ttl = (unsigned)mt() % tmp;81 行未改动 cout << " airs " << (vl[i].die ? "died " : "alive"); } SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);}//filling the chart //filling the chartinline void chart(int dep, int pcn) { cls(65, dep, 96, dep + 30); setpos(65, dep); cout << "+------------------------+"; for (int i = dep + 1; i <= dep + pcn + 2; ++i)22 行未改动 } int lin; system("cls"); setpos(0, (lin = stdd(in) + 1)); in.close(); cout << "are you ready to play?(tap any key to start)\n"; while (!_kbhit()); cls(0, lin, 50, lin + 1); //about the history(clf.txt) and post-gametime //about the history(clf.txt) and post-gametimegame: cls(0, lin, 50, lin + pc * 2 + 10); setpos(0, lin); int jscnt = 0; cout << "how much people do you want?\n"; cin >> pc; pc = max(pc, 2); pc = min(pc, 15); vector<peo>p(pc + 1); vector<peodo>pd(pc + 1); vector<double>atk(pc + 1);181 行未改动全部展开 } } } } //judge suddenly died(reflect doesn't includes) //judge suddenly died(reflect doesn't includes) for (int i = 0; i <= pc; ++i) { if (p[i].die) continue; if (atk[i]) { //0:water; 1:fire; 2:thunder; 3:wind; 4:grass; 5:rock; 6:ice //restrain: 0-1,1-4,4-3,3-2,2-5,5-6,6-0 //spread: 3 - 0/1/2/4/5/6 //spread: 3 - 0/1/2/4/5/6 //crystallize: 5 - 0/1/2/3/4/6 double trac = 1.0;#define bt(a,b) (v[a]|v[b]) if ((atktyp[i] & bt(0, 1)) == bt(0, 1))trac *= 0.9 * 1.05; //restrain,evaporation #define bt(a,b) (v[a]|v[b]) if ((atktyp[i] & bt(0, 1)) == bt(0, 1))trac *= 0.9 * 1.05; //restrain,evaporation if ((atktyp[i] & bt(0, 2)) == bt(0, 2))trac *= 1.2; //energize if ((atktyp[i] & bt(0, 3)) == bt(0, 3))trac *= 0.9; //spread if ((atktyp[i] & bt(0, 4)) == bt(0, 4))trac *= 1.05; //blooming if ((atktyp[i] & bt(0, 5)) == bt(0, 5))trac *= 1.1; //crystallize if ((atktyp[i] & bt(0, 6)) == bt(0, 6))trac *= 0.9 * 1.1; //restrain,solidify if ((atktyp[i] & bt(0, 4)) == bt(0, 4))trac *= 1.05; //blooming if ((atktyp[i] & bt(0, 5)) == bt(0, 5))trac *= 1.1; //crystallize if ((atktyp[i] & bt(0, 6)) == bt(0, 6))trac *= 0.9 * 1.1; //restrain,solidify if ((atktyp[i] & bt(1, 2)) == bt(1, 2))trac *= 1.1; //overload if ((atktyp[i] & bt(1, 3)) == bt(1, 3))trac *= 0.9; //spread if ((atktyp[i] & bt(1, 4)) == bt(1, 4))trac *= 0.9 * 1.1; //restrain,burn if ((atktyp[i] & bt(1, 5)) == bt(1, 5))trac *= 1.1; //crystallize if ((atktyp[i] & bt(1, 6)) == bt(1, 6))trac *= 1.05; //melt if ((atktyp[i] & bt(1, 4)) == bt(1, 4))trac *= 0.9 * 1.1; //restrain,burn if ((atktyp[i] & bt(1, 5)) == bt(1, 5))trac *= 1.1; //crystallize if ((atktyp[i] & bt(1, 6)) == bt(1, 6))trac *= 1.05; //melt if ((atktyp[i] & bt(2, 3)) == bt(2, 3))trac *= 0.9 * 1.05; //restrain,spread if ((atktyp[i] & bt(2, 4)) == bt(2, 4))trac *= 1.15; //activation if ((atktyp[i] & bt(2, 4)) == bt(2, 4))trac *= 1.15; //activation if ((atktyp[i] & bt(2, 5)) == bt(2, 5))trac *= 0.9 * 1.1; //restrain,crystallize if ((atktyp[i] & bt(2, 6)) == bt(2, 6))trac *= 1.2; //superconductivity if ((atktyp[i] & bt(2, 6)) == bt(2, 6))trac *= 1.2; //superconductivity if ((atktyp[i] & bt(3, 4)) == bt(3, 4))trac *= 0.9 * 1.05; //restrain,spread if ((atktyp[i] & bt(3, 5)) == bt(3, 5))trac *= 1.05 * 1.1; //spread,crystallize if ((atktyp[i] & bt(3, 6)) == bt(3, 6))trac *= 1.05; //spread if ((atktyp[i] & bt(4, 5)) == bt(4, 5))trac *= 1.1; //crystallize if ((atktyp[i] & bt(4, 6)) == bt(4, 6))trac *= 1.05; //irritability if ((atktyp[i] & bt(3, 5)) == bt(3, 5))trac *= 1.05 * 1.1; //spread,crystallize if ((atktyp[i] & bt(3, 6)) == bt(3, 6))trac *= 1.05; //spread if ((atktyp[i] & bt(4, 5)) == bt(4, 5))trac *= 1.1; //crystallize if ((atktyp[i] & bt(4, 6)) == bt(4, 6))trac *= 1.05; //irritability if ((atktyp[i] & bt(5, 6)) == bt(5, 6))trac *= 0.9 * 1.1; //restrain,crystallize#undef bt #undef bt //-Wl,--old_program down|| /*if (atktyp[i] == (v[0] | v[1])) trac = 0.8; else if (atktyp[i] == (v[0] | v[2])) trac = 1.2; else if (atktyp[i] == (v[0] | v[3])) trac = 1.1;21 行未改动 else if (atktyp[i] == (v[1] | v[2] | v[3] | v[4])) trac = 1.8; else trac = 1.0; atk[i] *= trac;*/
cout << i << " times " << (int)trac << "." << (int)(trac * 100) % 100 << ' '; //multiply to the atk val //multiply to the atk val if (atk[i]<def[i] || atk[i]>defr[i]) goto atkdie; if (deft[i] == pc + 1) { cout << '\n'; goto cmpref;34 行未改动 } default:break; } } //change airs they have //change airs they have if (p[0].die) { cout << "you died in this time!\n"; ifstream inn("clf.txt"); int tmp; inn >> tmp; vector<int>v1(tmp + 1); vector<string> v2(tmp + 1);17 行未改动 } //this for serval types of the end of the game SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); system("pause"); cls(0, lin, 50, lin + pc * 2 + 8); //reset,next role //reset,next role } SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); Sleep(2000); cout << "do you want to play again?(yes/no)\n"; string s; cin >> s; if (s == "yes") goto game; else cout << "thanks for you using!\n"; //if use again //if use again system("pause"); return 0;}```
## BBQ 2.1
```cpp#include<bits/stdc++.h> #include<iomanip> #include<Windows.h> #include<conio.h> #include<bits/stdc++.h>#include<iomanip>#include<Windows.h>#include<conio.h>#include<random>#include<mmsystem.h>#pragma comment(lib,"Winmm.lib")#ifndef _MSC_VER62 行未改动 for (int i = 0; i < str.size(); ++i) tmp += (int)str[i]; return tmp & 1;}//just for encryption //just for encryptioninline void setpos(int x = 0, int y = 0) { static COORD pos; pos.X = x; pos.Y = y; SetConsoleCursorPosition(GHOH, pos);}8 行未改动 setpos(x1, i); for (int j = x1; j <= x2; putchar(' '), j++); }}//set output pos and clear a part //set output pos and clear a partinline int stdd(ifstream& ist) { setpos(); int tmpl, tmpv; string tps; ist >> tmpl; cout << tmpl; for (int i = 1; i <= tmpl - 5; ++i) ist >> tmpv >> tps;6 行未改动 SCTA(GHOH, FGIN | FGRD | FGGN | FGBE); } return min(tmpl, 5);}//each time game start output //each time game start outputinline void bl(const vector<peo>& vl, int pcn, int dep) { switch (vl[0].mtyp) { case v[0]: { SCTA(GHOH, FGRD | FGGN | FGBE | BGIN | BGBE);68 行未改动 cout << " airs " << vl[i].bld << "blood\n"; } SCTA(GHOH, FGIN | FGRD | FGGN | FGBE);}//filling the chart //filling the chartinline void chart(int dep, int pcn) { cls(65, dep, 103, dep + 30); setpos(65, dep); cout << "+-------------------------------+"; for (int i = dep + 1; i <= dep + pcn + 2; ++i)321 行未改动全部展开 } getpos(tx, ty); setpos(100, nty); SCTA(GHOH, FGRD); for (int i = 0; i <= pc; ++i) { double trac = 1.0;#define bt(a,b) (v[a]|v[b]) if ((atkt[i] & bt(0, 1)) == bt(0, 1))trac *= 0.9 * 1.05; //restrain,evaporation #define bt(a,b) (v[a]|v[b]) if ((atkt[i] & bt(0, 1)) == bt(0, 1))trac *= 0.9 * 1.05; //restrain,evaporation if ((atkt[i] & bt(0, 2)) == bt(0, 2))trac *= 1.2; //energize if ((atkt[i] & bt(0, 3)) == bt(0, 3))trac *= 0.9; //spread if ((atkt[i] & bt(0, 4)) == bt(0, 4))trac *= 1.05; //blooming if ((atkt[i] & bt(0, 5)) == bt(0, 5))trac *= 1.1; //crystallize if ((atkt[i] & bt(0, 6)) == bt(0, 6))trac *= 0.9 * 1.1; //restrain,solidify if ((atkt[i] & bt(0, 4)) == bt(0, 4))trac *= 1.05; //blooming if ((atkt[i] & bt(0, 5)) == bt(0, 5))trac *= 1.1; //crystallize if ((atkt[i] & bt(0, 6)) == bt(0, 6))trac *= 0.9 * 1.1; //restrain,solidify if ((atkt[i] & bt(1, 2)) == bt(1, 2))trac *= 1.1; //overload if ((atkt[i] & bt(1, 3)) == bt(1, 3))trac *= 0.9; //spread if ((atkt[i] & bt(1, 4)) == bt(1, 4))trac *= 0.9 * 1.1; //restrain,burn if ((atkt[i] & bt(1, 5)) == bt(1, 5))trac *= 1.1; //crystallize if ((atkt[i] & bt(1, 6)) == bt(1, 6))trac *= 1.05; //melt if ((atkt[i] & bt(1, 4)) == bt(1, 4))trac *= 0.9 * 1.1; //restrain,burn if ((atkt[i] & bt(1, 5)) == bt(1, 5))trac *= 1.1; //crystallize if ((atkt[i] & bt(1, 6)) == bt(1, 6))trac *= 1.05; //melt if ((atkt[i] & bt(2, 3)) == bt(2, 3))trac *= 0.9 * 1.05; //restrain,spread if ((atkt[i] & bt(2, 4)) == bt(2, 4))trac *= 1.15; //activation if ((atkt[i] & bt(2, 4)) == bt(2, 4))trac *= 1.15; //activation if ((atkt[i] & bt(2, 5)) == bt(2, 5))trac *= 0.9 * 1.1; //restrain,crystallize if ((atkt[i] & bt(2, 6)) == bt(2, 6))trac *= 1.2; //superconductivity if ((atkt[i] & bt(2, 6)) == bt(2, 6))trac *= 1.2; //superconductivity if ((atkt[i] & bt(3, 4)) == bt(3, 4))trac *= 0.9 * 1.05; //restrain,spread if ((atkt[i] & bt(3, 5)) == bt(3, 5))trac *= 1.05 * 1.1; //spread,crystallize if ((atkt[i] & bt(3, 6)) == bt(3, 6))trac *= 1.05; //spread if ((atkt[i] & bt(4, 5)) == bt(4, 5))trac *= 1.1; //crystallize if ((atkt[i] & bt(4, 6)) == bt(4, 6))trac *= 1.05; //irritability if ((atkt[i] & bt(3, 5)) == bt(3, 5))trac *= 1.05 * 1.1; //spread,crystallize if ((atkt[i] & bt(3, 6)) == bt(3, 6))trac *= 1.05; //spread if ((atkt[i] & bt(4, 5)) == bt(4, 5))trac *= 1.1; //crystallize if ((atkt[i] & bt(4, 6)) == bt(4, 6))trac *= 1.05; //irritability if ((atkt[i] & bt(5, 6)) == bt(5, 6))trac *= 0.9 * 1.1; //restrain,crystallize#undef bt #undef bt if (atkr[i] && p[i].bld > 0) { int ttx, tty; getpos(ttx, tty), cout << i << " got " << atkr[i] << " attack value times " << trac, setpos(ttx, tty + 1);42 行未改动 if (p[i].qi < 0) p[i].bld += p[i].qi * 5; p[i].qi = max(p[i].qi, 0); if (p[i].bld < 0) lc--, p[i].bld = 0; } //change airs they have //change airs they have if (p[0].bld <= 0) { cout << "you died in this time!\n"; ifstream inn("clf.txt"); int tmp; inn >> tmp; vector<int>v1(tmp + 1); vector<string> v2(tmp + 1);19 行未改动 SCTA(GHOH, FGIN | FGRD | FGGN | FGBE); system("pause"); cls(0, lin, 50, lin + pc + 10); cls(100, 0, 150, pc * 2 + 2); //reset,next role //reset,next role } mciSS("pause game_music", 0, 0, 0); mciSS("resume prep_music", 0, 0, 0); SCTA(GHOH, FGIN | FGRD | FGGN | FGBE); Sleep(2000); cout << "do you want to play again?(yes/no)\n"; string s; cin >> s; if (s == "yes") goto game; else cout << "thanks for you using!\n"; //if use again //if use again system("pause"); mciSS("close game_music", NULL, 0, NULL); mciSS("close prep_music", NULL, 0, NULL); return 0;18 行未改动```
## BBQ 2.2```cpp#include<bits/stdc++.h> #include<iomanip> #include<Windows.h> #include<conio.h> #include<bits/stdc++.h>#include<iomanip>#include<Windows.h>#include<conio.h>#include<random>#include<mmsystem.h>#pragma comment(lib,"Winmm.lib")using namespace std;565 行未改动全部展开 p[i].qi = max(p[i].qi, 0); if (p[i].bld < 0) lc--, p[i].bld = 0; } } //change airs they have //change airs they have inline bool kinda_eog() { if (p[0].bld <= 0) { cout << "you died in this time!\n"; ifstream inn("clf.txt"); int tmp;24 行未改动 cout << "press any key to continue...\n"; MUF::wait_for(); cls(0, lin, 50, lin + pc + 10); cls(100, 0, 150, pc * 2 + 2); } //reset,next role //reset,next role inline void attack_judge() { /* for (int i = 0; i <= pc; ++i) { double trac = 1.0;170 行未改动全部展开 mciSS("resume prep_music", 0, 0, 0); SCTA(GHOH, FGIN | FGRD | FGGN | FGBE); Sleep(2000); cout << "do you want to play again?(yes/no)\n"; string s; cin >> s; if (s == "yes") goto game; else cout << "thanks for you using!\n"; //if use again //if use again MUF::wait_for(); mciSS("close game_music", NULL, 0, NULL); mciSS("close prep_music", NULL, 0, NULL); return 0;60 行未改动}int main() { srand((unsigned)time(NULL)); while (1) { memset(vis, false, sizeof(vis)); memset(vis, false, sizeof(vis)); memset(boom, false, sizeof(boom)); memset(clkfl, false, sizeof(clkfl)); cout << "please input column count,row count,boom count:\n"; cin >> size_x >> size_y >> size_b;99 行未改动#include<bits/stdc++.h>#include<Windows.h>#include<conio.h>using namespace std;const int jumphigh[7]={0,1,2,2,2,1,0}; const int jumphigh[7]={0,1,2,2,2,1,0};#define jh jumphighinline bool KD(int val) { return(GetAsyncKeyState(val)&0x8000)?1:0;}23 行未改动inline bool died(){ if(ty[1]==1&&(nt==0||nt==6)) return 1; if(ty[1]==2&&(nt!=2&&nt!=3&&nt!=4)) return 1; if(ty[1]==3&&(nt==2||nt==3||nt==4)) return 1; return 0; return 0;}inline void draw(int ps){ switch(ty[ps]){ case 1:{25 行未改动 SetConsoleTitle("dino developed by cyc"); Sleep(1000); MessageBox(NULL,"Wellcome to play dino developed by CYC","Welcome",MB_OK|MB_TOPMOST); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE); cout<<"are you ready to play?(tap any key to start)\n";while (!_kbhit()); cls(0,0,50,25); cls(0,0,50,25); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_BLUE); chart(); chart(); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN); mapp(); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);game: nxtj=7; while(1){ if(KD(0x26)&&!nt) nt=1; if(KD(0x26)&&!nt) nt=1; nj++; setpos(3,1); cout<<jk; tjs++; for(int i=0;i<=71;++i) ty[i]=ty[i+1]; if(died()){ setpos(0,9);43 行未改动