版本比较
恶魔轮盘赌(第三版)
标题
增加 1 行删除 1 行
11恶魔轮盘赌(第二版)恶魔轮盘赌(第三版)正文
增加 17 行删除 13 行
12134567251 行未改动全部展开2592602612622612632642652662675 行未改动273274275276275277278279280281282283284283284285286287288289290285286287288289290291292293294295296297298311 行未改动全部展开61061161261361061461561661761861962011 行未改动632633634635631进行了 AI 的一些微调
```cpp```c#include<bits/stdc++.h>using namespace std;#define int long long#define FAIL_FIND (18446744073709551615)251 行未改动全部展开 void update(){ if(gun.full==0)sure=0; if(gun._empty==0)sure=1; } int AI(){//-1打自己-2打对方1~ITEM_TYPE用道具 int AI(PLAYER p2){//-1打自己-2打对方1~ITEM_TYPE用道具 gun.compute(); update(); //不那么人机的操作 if(hp<MAX_HP&&item.exist(huazi))return huazi;5 行未改动 } if(sure==0&&item.exist(beer))return beer; if(sure==0)return -1; if(gun.top>=2&&item.exist(stopper)&&!stopper_used)return stopper; if(item.exist(chief))return chief; if(item.exist(chief)&&!p2.item.empty())return chief; if(hp>=2&&hp<=MAX_HP-2&&item.exist(bad_machine))return bad_machine; if(item.exist(bigger))return bigger; if(item.empty()){ if((gun.full>=gun._empty-1)||knife_used)return -2; else return -1; } else { if(random(1,3)<=1){ if((gun.full>=gun._empty-1)||knife_used)return -2;//用刀肯定不打自己(太唐了) else return -1; } else { while(true){ int type=random(1,ITEM_TYPE); if(item.exist(type))return type; while(true){ int type=random(1,ITEM_TYPE); if(item.exist(type)){ if(random(1,3)<=1){ if((gun.full>=gun._empty-1)||knife_used)return -2;//用刀肯定不打自己(太唐了) else return -1; } if(hp==MAX_HP&&type==huazi)continue; if(p2.item.empty()&&type==chief)continue; return type; } } } }311 行未改动全部展开 cout<<endl<<endl<<endl; cout<<"枪里还有"<<gun.top<<"发子弹"<<endl; cout<<"实弹:"<<gun.full<<" 空弹:"<<gun._empty<<endl; if(p1.ai){ int _type=p1.AI(); int _type=p1.AI(p2); compute(p1,p2,_type); if(_type>=1&&_type<=ITEM_TYPE)p1.item.pop(p1.item.bound(_type)); } else { cout<<"你要干什么?-1打自己,-2打对方,1~"<<p1.item.top<<"用物品\n";11 行未改动 system("cls"); } return 0;}```