• 个人简介


    Learning is like rowing against the current, if you don't advance, you will fall behind. From-Dream__P__R__C

    https://ys.mihoyo.com/cloud/?utm_source=default#/

    tlbc240l.typingclub.com

    TLBC:turing123

    我的世界外挂:[!不可查看!]

    sans:http://jcw87.github.io/c2-sans-fight/

    我的世界百科:https://www.mcmod.cn/

    我的世界wiki:https://zh.minecraft.wiki/

    我的世界wiki(另一):https://minecraft.fandom.com/zh/wiki/Minecraft_Wiki

    TNOwiki:https://the-new-order-last-days-of-europe.fandom.com/zh/wiki/_Wiki

    怪核:http://liminal-archives-cn.wikidot.com

    @qiongjing=)

    B站:“暗区吴钱”

    哔哩哔哩:https://www.bilibili.com/

    后室版本:

    后室w:http://Backrooms-wiki-cn.wikidot.com

    云室:http://backroom-wiki-cn.wikidot.com/

    K.BACEROOMS:https://kanepixelsbackrooms.fandom.com/zh/

    后室f: https://backrooms.fandom.com/zh/wiki/Backrooms_Wiki

    后室E:http://backrooms-world.wikidot.com/

    后室T:http://backrooms-t-wiki.wikidot.com/

    后室An:https://antirooms.fandom.com/zh/wiki/Antirooms_Wiki?variant=zh-tw

    后室D:https://backroomsd.fandom.com/zh/wiki/BackroomsD_Wiki

    YOUX:https://kbhgames.com/

    /* end: bad end 1(饿死了) 10 0->去邻居家 2(丧尸咬死) 1 9->在家->商场 3(家中疯了) 0 10->在家->在家(多刷几次) 4(做任务1个人) 7 3->在家->商场->给子弹->杀出去->3交换->留在这->1个人做 5(死在基地) 5 5->在家->商场->给食物->杀出去->2交换->留在这 6(少年咬死) 5 5->在家->商场->不给->杀出去->4交换->离开->当天离开->带上->水管->一起2楼->枪->不杀 7(被狗咬死) 5 5->在家->商场->不给->杀出去->4交换->离开->当天离开->带上->水管->一起2楼->食物->找->其他入口 8(妹子杀死) 先达成线索 2和4->按true end2过程走(妹子要活着) 9(实验体) 5 5->在家->前往商场->不给->杀出去->3交换->离开->当天离开->带上->不给->独自2楼->食物打发->去找他->寻找其他入口 10(另一个基地) 5 5->在家->前往商场->不给->杀出去->3交换->离开->当天离开->带上->给枪->独自1楼->食物打发 11(子弹不足) 0 10->去邻居家 12(被击毙) 通关基础剧情(已领取)->0 10->在家->在家 13(反杀) 通关基础剧情(已领取)->1 9->在家->在家 14(到外面) 通关基础剧情(已领取)->7 3->在家->商场->给子弹->杀出去->0交换->离开->当天离开->带上->不给->独自2楼->食物打发->不找他 15(新笔迹) 通关基础剧情(已领取)->按bad end9过程走 happy end happy end1:0 10->在家->在家(多刷几次) heppy end2:7 3->在家->商场->给子弹->杀出去->3交换->留在这->一起 happy end3:7 3->在家->商场->食物->守着->0交换->留在这 happy end4:7 3->在家->商场->食物->守着->0交换->离开->当天离开->带上->水管->一起2楼->食物 happy end5:达成happy end4->5 5->在家->商场->不给->杀出去->3交换->离开->当天离开->带上->水管->一起2楼->枪->安抚他 true end true end1:7 3->在家->商场->食物->守着->0交换->离开->当天离开->带上->枪->单独1楼 true end2:5 5->在家->前往商场->食物->杀出去(这时候20%妹子不s) true end3:5 5->在家->前往商场->不给->杀出去->3交换->离开->当天离开->带上->水管->一起2楼->枪->不杀 true end4:通关基础剧情->不领取 true end5:通关基础剧情(已领取)->7 3->在家->商场->食物->守着->0交换->离开->当天离开->带上->水管->一起2楼->枪->杀 线索 基础线索 线索1 达成true end1 线索2 达成true end3 线索3 5 5->在家->前往商场->不给->杀出去->3交换->离开->当天离开->带上->水管->一起2楼->枪->杀 线索5 达成bad end8 线索4 达成true end2 线索6 达成bad end9 进阶线索 线索1 s50次(主页面按7刷) 线索2 达成true end4 线索3 达成bad end13 线索4 达成bad end15 线索5 达成true end5 线索6 达成bad end14 总体攻略: 基础剧情通关:6基础线索达成->bad end10走一遍 接下来是两条线(分开的) 1.通关进阶剧情 开启进阶结局:6进阶线索达成->线索(主页面)->团结起来 进阶剧情通关:开启进阶结局->按bad end14走 2.尸王线 开启尸王线:6进阶线索达成->线索(主页面)->杀光->15bad end达成->成就(主页面) 终极剧情通关:尸王线->在家->商场->杀了->杀出去->0交换->离开->当天离开->带上->水管->一起2楼->枪->杀 最后:建议把if(v>=12&&qxs0)(在1560行)改为if(v>=12&&swx0),这样可以三条线都体验一遍 另:子弹食物分配输入666666 5201314(假的)有意想不到的效果哦!(线索中可以刷到)

    #include <vector>
    #include <algorithm>
    #include <random>
    #include <string>
    using namespace std;
    
    struct Card{
        int num;    //2~14 (11J,12Q,13K,14A)
        int suit;   //0?黑桃,1?红桃,2?梅花,3?方块
    };
    string getSuit(int s){
        if(s==0) return "?";
        if(s==1) return "?";
        if(s==2) return "?";
        return "?";
    }
    string getNum(int n){
        if(n==11) return "J";
        if(n==12) return "Q";
        if(n==13) return "K";
        if(n==14) return "A";
        return to_string(n);
    }
    
    struct HandRes{
        int type;
        vector<int> key;
    };
    
    HandRes calcHand(vector<Card> c){
        vector<int> nums;
        bool sameSuit=true;
        for(auto &x:c) nums.push_back(x.num);
        sort(nums.begin(),nums.end());
        int s0=c[0].suit;
        for(auto &x:c) if(x.suit!=s0) sameSuit=false;
    
        if(nums[0]==nums[1]&&nums[1]==nums[2]) return {5,{nums[0]}}; //豹子
        if(nums[0]==nums[1]||nums[1]==nums[2]){//对子
            int pair=nums[1];
            int single=(nums[0]==nums[1])?nums[2]:nums[0];
            return {1,{pair,single}};
        }
        bool isStraight=false;
        if(nums[0]==2&&nums[1]==3&&nums[2]==14){
            isStraight=true;
            nums={1,2,3};
        }else if(nums[2]-nums[1]==1&&nums[1]-nums[0]==1){
            isStraight=true;
        }
        if(sameSuit&&isStraight) return {4,{nums[2]}};//顺金
        if(sameSuit) return {3,{nums[2],nums[1],nums[0]}};//金花
        if(isStraight) return {2,{nums[2]}};//顺子
        return {0,{nums[2],nums[1],nums[0]}};//单张
    }
    
    int compareHand(HandRes a,HandRes b){
        if(a.type!=b.type) return a.type>b.type?1:-1;
        for(int i=0;i<a.key.size();i++){
            if(a.key[i]>b.key[i]) return 1;
            if(a.key[i]<b.key[i]) return -1;
        }
        return 0;
    }
    string getTypeName(int t){
        if(t==5)return "豹子";
        if(t==4)return "顺金";
        if(t==3)return "金花";
        if(t==2)return "顺子";
        if(t==1)return "对子";
        return "单张";
    }
    
    mt19937 rng(random_device{}());
    
    struct Player{
        string name;
        int money;
        vector<Card> cards;
        bool isSee;
        bool fold;
        bool isHuman;
    };
    
    int main(){
        const int baseBet=20;
        int totalPlayer;
        int luck;
        cout << "===== 炸金花 =====\n";
        cout << "幸运度(1~10,越大越好牌越多): ";
        cin >> luck;
        if(luck < 1) luck = 1;
        if(luck >10) luck = 10;
    
        cout << "请输入总人数(2~6): ";
        cin >> totalPlayer;
        if(totalPlayer<2||totalPlayer>6){
            cout << "人数非法,默认2人\n";
            totalPlayer=2;
        }
        vector<Player> players;
        players.push_back({"玩家",1000,{},false,false,true});
        for(int i=1;i<totalPlayer;i++){
            players.push_back({"AI"+to_string(i),1000,{},false,false,false});
        }
    
        while(true){
            //存活人数检测
            int aliveCnt=0;
            for(auto &p:players) if(p.money>0) aliveCnt++;
            if(aliveCnt<=1){
                cout<<"\n====游戏结束===="<<endl;
                for(auto &p:players){
                    cout<<p.name<<" 筹码:"<<p.money<<endl;
                }
                break;
            }
            cout<<"\n--------新一局--------\n";
    
            vector<Card> deck;
            for(int suit=0;suit<4;suit++)
                for(int num=2;num<=14;num++)
                    deck.push_back({num,suit});
            shuffle(deck.begin(),deck.end(),rng);
    
            //发牌 + 幸运度控制玩家手牌
            for(auto &p:players){
                p.cards.clear();
                p.isSee=false;
                p.fold=false;
            }
            int cardIdx=0;
            for(auto &p:players){
                for(int i=0;i<3;i++){
                    p.cards.push_back(deck[cardIdx++]);
                }
                //只有玩家受幸运度影响
                if(p.isHuman){
                    HandRes hr = calcHand(p.cards);
                    uniform_int_distribution<int> dist(1,10);
                    int roll = dist(rng);
                    //幸运越低,差牌强制重抽概率越高
                    if(hr.type <= 1 && roll > luck){
                        //重新抽3张
                        for(int i=0;i<3;i++) p.cards[i] = deck[cardIdx++];
                    }
                }
            }
    
            int pot=0;
            //扣底注
            for(auto &p:players){
                if(p.money>=baseBet){
                    p.money -= baseBet;
                    pot += baseBet;
                }else{
                    p.fold=true;
                }
            }
    
            bool roundEnd=false;
            int cur=0;
            while(!roundEnd){
                while(cur<players.size() && (players[cur].fold || players[cur].money<=0)){
                    cur=(cur+1)%players.size();
                }
                if(cur>=players.size()) break;
                Player &now = players[cur];
                int alive=0;
                for(auto &pp:players) if(!pp.fold) alive++;
                if(alive<=1){
                    roundEnd=true;
                    break;
                }
    
                cout<<"\n底池:"<<pot<<" | 轮到"<<now.name<<" 筹码:"<<now.money;
                if(now.isSee) cout<<" [已看牌]";
                else cout<<" [闷牌]";
                cout<<endl;
    
                if(now.isHuman){
                    cout<<"【1闷牌下注 2看牌 3跟注 4加注 5梭哈 6弃牌 7开牌】\n请选择:";
                    int op;
                    cin>>op;
                    if(op==1){
                        if(now.isSee){cout<<"不能闷牌,你已经看牌\n";continue;}
                        int bet=baseBet/2;
                        if(now.money<bet){cout<<"筹码不足\n";continue;}
                        now.money -= bet; pot += bet;
                        cout<<"你闷牌下注"<<bet<<endl;
                    }else if(op==2){
                        now.isSee=true;
                        cout<<"你的手牌:";
                        for(auto &cd:now.cards) cout<<getSuit(cd.suit)<<getNum(cd.num)<<" ";
                        HandRes hr=calcHand(now.cards);
                        cout<<"\n牌型:"<<getTypeName(hr.type)<<endl;
                    }else if(op==3){
                        int need = now.isSee?baseBet:(baseBet/2);
                        if(now.money<need){cout<<"筹码不足\n";continue;}
                        now.money -= need; pot += need;
                        cout<<"你跟注"<<need<<endl;
                    }else if(op==4){
                        if(!now.isSee){cout<<"必须看牌后才能加注\n";continue;}
                        int add;
                        cout<<"输入加注金额:";cin>>add;
                        if(add<=0||add>now.money){cout<<"金额非法\n";continue;}
                        now.money -= add; pot += add;
                        cout<<"你加注"<<add<<endl;
                    }else if(op==5){
                        int all=now.money;
                        now.money=0; pot+=all;
                        cout<<"你梭哈!强制结算\n";
                        roundEnd=true;
                        break;
                    }else if(op==6){
                        now.fold=true;
                        cout<<"你弃牌\n";
                    }else if(op==7){
                        if(!now.isSee){cout<<"闷牌不能开牌!\n";continue;}
                        cout<<"你选择开牌,结算\n";
                        roundEnd=true;
                        break;
                    }
                }else{
                    //AI策略,闷牌不会轻易跑路
                    HandRes aiHand=calcHand(now.cards);
                    int score=aiHand.type*100 + aiHand.key[0];
                    uniform_int_distribution<int> rd(0,99);
                    int r=rd(rng);
                    if(!now.isSee){
                        if(score >= 300){
                            now.isSee=true;
                            cout<<"AI看牌\n";
                        }else if(r<75){
                            int bet=baseBet/2;
                            if(now.money>=bet){
                                now.money -= bet; pot+=bet;
                                cout<<"AI闷跟"<<bet<<endl;
                            }else {now.fold=true;cout<<"AI弃牌\n";}
                        }else{
                            now.fold=true;
                            cout<<"AI弃牌\n";
                        }
                    }else{
                        if(score>=400){
                            if(r<70 && now.money>baseBet){
                                int add=baseBet;
                                now.money -= add; pot+=add;
                                cout<<"AI加注"<<add<<endl;
                            }else{
                                cout<<"AI选择开牌\n";
                                roundEnd=true;
                                break;
                            }
                        }else if(score>=100){
                            int need=baseBet;
                            if(now.money>=need){
                                now.money -= need; pot+=need;
                                cout<<"AI跟注"<<need<<endl;
                            }else {now.fold=true;cout<<"AI弃牌\n";}
                        }else{
                            if(r<35 && now.money>=baseBet){
                                now.money -= baseBet; pot+=baseBet;
                                cout<<"AI硬跟"<<baseBet<<endl;
                            }else{
                                now.fold=true;
                                cout<<"AI弃牌\n";
                            }
                        }
                    }
                }
                cur=(cur+1)%players.size();
            }
    
            //结算
            cout<<"\n--------结算--------\n";
            vector<Player*> winList;
            HandRes bestHand;
            bool first=true;
            for(auto &p:players){
                if(p.fold) continue;
                HandRes h=calcHand(p.cards);
                cout<<p.name<<" : ";
                for(auto &cd:p.cards) cout<<getSuit(cd.suit)<<getNum(cd.num)<<" ";
                cout<<" | "<<getTypeName(h.type)<<endl;
                if(first){
                    bestHand=h;
                    winList.push_back(&p);
                    first=false;
                }else{
                    int cr=compareHand(h,bestHand);
                    if(cr==1){
                        bestHand=h;
                        winList.clear();
                        winList.push_back(&p);
                    }else if(cr==0){
                        winList.push_back(&p);
                    }
                }
            }
            int split = pot / winList.size();
            cout<<"底池:"<<pot<<",赢家每人分得 "<<split<<endl;
            for(auto wp:winList){
                wp->money += split;
                cout<<wp->name<<"赢取 "<<split<<endl;
            }
            //弃牌展示手牌
            for(auto &p:players){
                if(p.isHuman && p.fold){
                    cout<<"【你弃牌,手牌:";
                    for(auto &cd:p.cards) cout<<getSuit(cd.suit)<<getNum(cd.num)<<" ";
                    HandRes hr=calcHand(p.cards);
                    cout<<" | "<<getTypeName(hr.type)<<"】\n";
                }
            }
        }
        return 0;
    }
    
    
    

    图灵编程怪谈:

    1. ——————————————————
    2. ——————————————————
    3. ——————————————————
    4. ——————————————————
    5. ——————————————————
    6. 因为怕被某人发现而导致死亡,所以怪谈已被隐藏

    tl3565555 https://hzclog.com https://Papergames.io https://claycoffee.github.io/wbwwb/ https://desmos.com https://toolb.cn https://nazo.one-story.cn/ :game.hullqin.cn https://www.cardzmania.com/ https://boardgamearena.com/ https://www.cardzmania.com/games/TeenPatti https://poket52.com/games/teen-patti/

  • 通过的题目

  • 最近活动

题目标签

TL/一阶
49
简单分支
11
模拟
8
NOIP全国联赛普及组
7
其他
6
数学
6
输入输出
5
分支问题
5
循环问题
5
拆位问题
4
for循环
3
循环求和
3
基础问题
3
一本通编程启蒙
3
2005
2
循环嵌套
2
字符串
2
TL
2
一阶
2
最值问题
2