最近很流行的机器人话题,我贴一部分用按键精灵写的代码
很多平台都有机器人的,这确实是事实,PS ipoker都爆过机器人,像ps 的plo 200都有机器人赢了好像大概200w刀?不过这机器人肯定不是像另外一个帖子提到的什么翻牌前不管任何牌都跟别人all in,假如这是机器人的话,那写这个程序的程序员肯定是个智障。我贴的这个程序去年以前大概能打赢德扑圈的1-2不带anti的级别,总体来讲这个程序打得特别的紧弱,spr>6面对flop的raise它能弃掉底set,在天顺,天花面顶set都会弃掉,所以这程序大概赢率是3bb/100h左右吧,比较弱智,以下是部分源码Function 翻牌(card1, card2, color1, color2, a1, a2, a3, b1, b2, b3, id)Dim flopface,pairface,flashface,wet,power,drawflopface = 牌面(a1, a2, a3, b1, b2, b3)pairface = CInt(Mid(flopface, 1, 1))flashface = CInt(Mid(flopface, 2, 1))straightface= CInt(Mid(flopface, 3, 1))wet=CInt(Mid(flopface, 3, 1))power=牌力(card1,card2,color1,color2,a1,a2,a3,b1,b2,b3)draw=Lib.德扑数学.听牌(card1,card2,color1,color2,a1,a2,a3,b1,b2,b3)if pairface=2 thenif power=12 then翻牌= "6"+CStr(wet)ElseIf power = 4 and card1 >= 12 and card1 >= a1 Then翻牌= "5"+CStr(wet)elseif power=4 and card1<=11 and card1>=a1 then翻牌 = "4" + CStr(wet)ElseIf power >= 1 Then翻牌 = "2" + CStr(wet)ElseIf prepower <= 3 Then//AK翻牌 = "1" + CStr(wet)else 翻牌= "0"+CStr(wet)end ifelseifpairface=1 thenif power>=11 then翻牌= "6"+CStr(wet)elseif power>=4 thenif power=5 and a1<>14 and a2<>14 and a3<>14 and (card1=14 or card2=14) then翻牌= "5"+CStr(wet)elseif card1>=11 and power=4 or power=5 Then翻牌 = "4" + CStr(wet)Else 翻牌 = "2" + CStr(wet)end ifelseif power>=3 or draw>=2 then翻牌 = "2" + CStr(wet)ElseIf power = 2 Then翻牌 = "1" + CStr(wet)else 翻牌= "0"+CStr(wet)end ifelseif flashface=1 thenif power=10 and (card1=14 or card2=14) or power=12 then翻牌= "6"+CStr(wet)elseif power=10 and (card1>=12 or card2>=12) then翻牌= "5"+CStr(wet)elseif power=10 then翻牌= "4"+CStr(wet)elseif card1=14 and color1=b1 or card2=14 and color2=b2 or power=7 or power=8 or card1=13 and color1=b1 and Lib.德扑数学.三取大(a1, a2, a3)=14 or card2=13 and color2=b2 and Lib.德扑数学.三取大(a1, a2, a3)=14 then翻牌= "3"+CStr(wet)elseif power>=3 then翻牌 = "2" + CStr(wet)else 翻牌= "0"+CStr(wet)end ifelseif straightface>=1 thenIf power >= 10 or power = 9 and card1 <> Lib.德扑数学.四取小(card1, a1, a2, a3) and card2 <> Lib.德扑数学.四取小(card2, a1, a2, a3) or power = 9 and Lib.德扑数学.五取大(card1,card2, a1, a2, a3)=14 and Lib.德扑数学.五取小(card1,card2, a1, a2, a3)=10 or power = 9 and Lib.德扑数学.五取大(card1,card2, a1, a2, a3)=14 and Lib.德扑数学.五取小(card1,card2, a1, a2, a3)=5 and card1<>14 and card2<>14 Then翻牌= "6"+CStr(wet)elseif power>=7 then翻牌= "5"+CStr(wet)ElseIf power >= 4 ThenIf card1<=10 and power = 4 Then翻牌 = "2" + CStr(wet)Else 翻牌 = "4" + CStr(wet)End Ifelseif draw>=2 then翻牌= "3"+CStr(wet)elseif power=3 then翻牌 = "2" + CStr(wet)ElseIf power = 2 Then翻牌 = "1" + CStr(wet)else 翻牌= "0"+CStr(wet)end ifelseif power>=8 and card1 <> Lib.德扑数学.四取小(card1, a1, a2, a3) and card2 <> Lib.德扑数学.四取小(card2, a1, a2, a3) or power>=7 and wet>=2 or power=7 and 翻牌两高张()=1 Then翻牌= "6"+CStr(wet)elseif power>=6 then翻牌= "5"+CStr(wet)elseif power>=4 thenIf card1<=10 and power = 4 Then翻牌 = "2" + CStr(wet)Else 翻牌 = "4" + CStr(wet)End Ifelseif draw>=2 then翻牌= "3"+CStr(wet)elseif power=3 then翻牌 = "2" + CStr(wet)elseif power=2 then翻牌 = "1" + CStr(wet)else 翻牌= "0"+CStr(wet)end ifEnd IfIf prepower = 10 Then翻牌 = "0" + CStr(wet)dm.WriteFile "排错.txt", " id=" +id+ CStr(session)End Ifdm.WriteFile id+".txt", "翻牌圈牌力=" + CStr(power)dm.WriteFile id+".txt", "翻牌圈听牌=" + CStr(draw)dm.WriteFile id+".txt", "翻牌圈成对牌面=" + CStr(pairface)dm.WriteFile id+".txt", "翻牌圈同花牌面=" + CStr(flashface)dm.WriteFile id+".txt", "翻牌圈湿度=" + CStr(wet)end functionFunction 牌面(a, b, c, x, y, z)Dim min,mid2,max,flashface,straightface,pairface,wetmin = Lib.德扑数学.三取小(a, b, c)mid2 = Lib.德扑数学.三取中(a, b, c)max = Lib.德扑数学.三取大(a, b, c)flashface = 0straightface = 0pairface = 0wet= 0if a=b and a=c then牌面 = "2000"Exit Functionend ifif max=mid2 or max=min or mid2=min thenpairface=1end ifif max-min<=3 or max-min=4 and min>=10 thenstraightface=1elseif max-min=4 thenstraightface=2end ifif x=y and y=z thenflashface=1elseif x=y or x=z or y=z thenflashface=2end ifif pairface=1 thenif flashface=2 thenwet=1else wet=0end ifelseif flashface=1 and straightface>=1 thenwet=4elseif flashface=1 and straightface=0 thenwet=3elseif flashface=2 and straightface=1 thenwet=3elseif flashface=2 thenwet=2elseif straightface>=1 thenwet=1end if牌面= CStr(pairface)+CStr(flashface)+CStr(wet)+CStr(straightface)end functionfunction 牌力(c1,c2,r1,r2,a,b,c,x,y,z)if Lib.德扑数学.同花(r1,r2,x,y,z)=1 and Lib.德扑数学.顺子(c1,c2,a,b,c)=1 or Lib.德扑数学.四条(c1,c2,a,b,c)=1 then牌力 = 12ElseIf Lib.德扑数学.带A明三(c1, c2, a, b, c) = 1 ThenMessageBox "有带A明三"牌力= 12elseif Lib.德扑数学.葫芦(c1,c2,a,b,c)=1 then牌力= 11elseif Lib.德扑数学.同花(r1,r2,x,y,z)=1 then牌力= 10elseif Lib.德扑数学.顺子(c1,c2,a,b,c)=1 then返回值 = Lib.德扑翻牌圈.牌力(c1,c2,r1,r2,a,b,c,x,y,z)牌力= 9elseif Lib.德扑数学.暗三(c1,c2,a,b,c)>=2 then牌力= 8elseif Lib.德扑数学.暗三(c1,c2,a,b,c)=1 then牌力= 7elseif Lib.德扑数学.明三(c1,c2,a,b,c)=1 then牌力= 5elseif Lib.德扑数学.顶两对(c1,c2,a,b,c)=1 then牌力= 6elseif Lib.德扑数学.中两对(c1,c2,a,b,c)=1 then牌力= 5elseif Lib.德扑数学.底两对(c1,c2,a,b,c)=1 then牌力= 5elseif Lib.德扑数学.超对(c1,c2,a,b,c)=1 then牌力= 4elseif Lib.德扑数学.顶对(c1,c2,a,b,c)=1 then牌力= 3elseif Lib.德扑数学.中对(c1,c2,a,b,c)=1 then牌力= 2elseif Lib.德扑数学.底对(c1,c2,a,b,c)=1 then牌力= 1else 牌力= 0End IfTracePrint "牌力="+CStr(牌力)End Function这是按键精灵写的,我想大部分程序员都可以看懂个大概,看起来像是伪代码,实际上就是源码,想要源码的不用私聊我了,不会回,更不会给的。 看不懂,但觉得很厉害static/image/smiley/default/tongue.gif看不懂,但觉得很厉害 这部分代码是对自己手牌在翻牌圈的牌力判断,其实大部分机器人程序都比较弱智,程序员的想法很多时候理论上看起来很容易实现,但实际上你写程序的过程中会碰到各种各样的问题,很难把自己的策略都一一实现,所以这种机器人的核心策略都比较简单机械化,跟“冷扑大师”这种人工智能差距太远,打不赢这种机器人肯定是牌手自己的问题。 再简单的机器人起码不会情绪化,被动严格的遵守纪律··static/image/smiley/default/lol.gif
流弊。楼主有为平台编过程序吗? 一般平台就算真有机器人也只是为了填桌,打不打得过真人还另说呢,不用太担心这些。
頁:
[1]