『第
25 楼』:
发布斗地主无AI测试版
非正式发布斗地主无AI测试版
目前勉强可以拿出来看看,但还有很多需要完善和修改.
如有任何意见建议欢迎回帖或加QQ群:3401238
@echo off&SETLOCAL ENABLEDELAYEDEXPANSION&(CHCP 437 &GRAFTABL 936)>NUL
set a=s1=A;s2=2;s3=3;s4=4;s5=5;s6=6;s7=7;s8=8;s9=9;s10=0;s11=J;s12=Q;s13=K;s14=A;s15=2;s16=N;s17=N;h1=;h2=;h3=;h4=;h0=T;y0=c;y1=0;p=1
set pk%a:;=&set pk%
SET SYBCOM=A100;80BE AC00 23C 5472 3CAC 7501 BE13 282;0EEB 3CAC 743A 3C09 740D 8347 1EE 46EB;E8AC 90 A2E8 3C00 7F18 8837 E8C6 84;96E8 3C00 7F4F 882B B0C2 F602 50E2 A0B0;E6F6 15F 57C7 3CAC 7424 E80A 67 45E8;8800 EBD1 E817 3B D188 10EB B0 16CD;E088 4CB4 21CD 815F A0C7 5700 B850 B800;0750 295A 88F5 ACCA 243C D974 3B3C 9274;0D3C DE74 233C 575 D783 EB01 AA01 D088;EBAA E8E4 1E C387 393C 27E 904 FB80;7E39 8003 9C3 F24 E380 B20F F610 E2;88D8 C3C2 3CAC 7420 3CFB 740D 88A5 ACC3;203C F074 D3C 9A74 87C3 2CC3 8030 30EB;0AB4 E4F6 D800 C3
SET V=;RCX;D7;N SYBC.COM;W;Q
if not exist sybc.com (ECHO.%SYBCOM:;=&ECHO.DW %&ECHO.%V:;=&ECHO.%)|DEBUG>NUL
set DEBUGQK=1F8 267;298 307;338 3a7;3D8 447;478 4e7;518 587;5B8 627;658 6c7;6F8 767;798 807;838 8a7;8D8 947;978 9e7;A18 a87;AB8 b27
set pkBK=$7f
set pkBK2=$f7
set pkBK3=$37
set pkBK4=$73
set pkNB=$f1
color 3e
echo 斗地主 测试版
echo.
echo 目前没有AI,电脑不会出牌.你可以随便出牌,出完自动发牌.
echo.
echo 目前可用按键及其功能:
echo F2 从新发牌 F5 刷新
echo 方向键 控制扑克 空格 出牌
echo.
echo 按任意键开始...
sybc
:win
:2
for /l %%b in (3,1,11) do set /a pr=!random!%%4+1&&for /f %%a in ("!pr!") do set pbh%%b=!pkh%%a!&&set pby%%b=!pky0!&&if %%a gtr 2 set pby%%b=!pky1!
for /l %%b in (4,1,12) do set /a pr=!random!%%4+1&&for /f %%a in ("!pr!") do set pch%%b=!pkh%%a!&&set pcy%%b=!pky0!&&if %%a gtr 2 set pcy%%b=!pky1!
call :FP
:1
set titds=$f
cls
set t1=%time%
sybc 10000%TITDS%0 :::│%TITDS%c积%TITDS%9 电脑左 %TITDS%00 %TITDS%2+0%TITDS%c=%TITDS%00 %TITDS%0│%TITDS%c 斗地主 V0.0 [测试版] %TITDS%0│%TITDS%0 [庄家] %TITDS%0│ 底 牌 │:::
sybc 10100%TITDS%0 ::│%TITDS%c分%TITDS%9 电脑右 %TITDS%00 %TITDS%2+0%TITDS%c=%TITDS%00 %TITDS%0│%TITDS%9 开发者:SYBN netbenton %TITDS%0│%TITDS%9 电脑左 %TITDS%0│ │::
sybc 10200%TITDS%0 :│%TITDS%c榜%TITDS%9 玩家SYBN %TITDS%00 %TITDS%2+0%TITDS%c=%TITDS%00 %TITDS%0│%TITDS%22010-3-13 按F1查看帮助%TITDS%0│%TITDS%d 叫分 3分 %TITDS%0│ │:
sybc 10168%TITDS%%pdi1y%%pdi1s% %TITDS%%pdi2y%%pdi2s% %TITDS%%pdi3y%%pdi3s%;%TITDS%%pdi1y%%pdi1h% %TITDS%%pdi2y%%pdi2h% %TITDS%%pdi3y%%pdi3h%
call :pb 10701
call :pb 10769
sybc 10300$4c☉$4c▄▄▄▄$4c☉;$c4▌$c9 电脑左 $4c▌;$c4▌$ce余牌11张$4c▌;$4c☉$c4▄▄▄▄$4c☉
sybc 10368$4c☉$4c▄▄▄▄$4c☉;$c4▌$c9 电脑右 $4c▌;$c4▌$ce余牌7 张$4c▌;$4c☉$c4▄▄▄▄$4c☉
sybc 11400$4c☉$4c▄▄▄▄$4c☉;$c4▌$c9玩家SYBN$4c▌;$c4▌$ce余牌17张$4c▌;$4c☉$c4▄▄▄▄$4c☉
call :p11
:for /l %%a in (3,1,11) do set /a wz=10352+%%a*3-9*3&&call :pa !wz! !pby%%a! !pks%%a! !pbh%%a! 农 民
:for /l %%a in (4,1,12) do set /a wz=10800+%%a*3&&call :pa !wz! !pcy%%a! !pks%%a! !pch%%a! 地 主
set t2=%time%
call :timec
:GB
::title 请选择您要出的牌...
set /a GBy=12212,GBs=1
:GB1
set /a GBW=12209+GBs*3
sybc %GBy%f1 ;:%GBw%f1↑
sybc
title sybc-%errorlevel%-
if %errorlevel% == 75 set /a GBs-=1
if %errorlevel% == 77 set /a GBs+=1
if %errorlevel% == 72 set /a p2w%GBs%=1&&call :p11 1 %GBs%
if %errorlevel% == 80 set /a p2w%GBs%=0&&call :p11 0 %GBs%
if %errorlevel% == 57 goto chupai
if %errorlevel% == 60 goto 2
if %errorlevel% == 63 goto 1
if %GBs% lss 1 set gbs=%p2z%
if %GBs% gtr %p2z% set gbs=1
set /a GBy=GBw
goto :GB1
:chupai
set /a p6s=0,p6h=0,p6y=0,p6z=0,p0s=0,p0h=0,p0y=0,p0z=0,p2zBF=%p2z%
set p2sBF=%p2s%
set p2hBF=%p2h%
set p2yBF=%p2y%
for /l %%a in (1,1,%p2z%) do if !p2w%%a! == 1 (set /a p6z=p6z+1&&set p6s=!p6s!!p2s:~%%a,1!&&set p6h=!p6h!!p2h:~%%a,1!&&set p6y=!p6y!!p2y:~%%a,1!&&set p6js=农 民) else (set /a p0z=p0z+1&&set p0s=!p0s!!p2s:~%%a,1!&&set p0h=!p0h!!p2h:~%%a,1!&&set p0y=!p0y!!p2y:~%%a,1!)
for /l %%a in (1,1,%p0z%) do (set /a p2z=p0z&&set p2s=!p0s!&&set p2h=!p0h!&&set p2y=!p0y!)
:yanzheng
set px=违规
set p6yx=0
::标记字符串对应的牌
set ps=---34567890JQKA02N$
::初始化
for /l %%a in (0,1,4) do set pss%%a=0
for %%a in (3 4 5 6 7 8 9 0 J Q K A 2 N) do set ps%%a=0&set p6zs%%a=0
::计算各中点数的牌的数量
for /l %%a in (1,1,20) do for /f %%b in ("!p6s:~%%a,1!") do set /a ps%%b+=1
::计算牌的数量
set /a p6zs=%ps3%+%ps4%+%ps5%+%ps6%+%ps7%+%ps8%+%ps9%+%ps0%+%psj%+%psq%+%psk%+%psa%+%ps2%+%psn%
::获取标记字符串%p6ss%
set p6ss=---%ps3%%ps4%%ps5%%ps6%%ps7%%ps8%%ps9%%ps0%%psj%%psq%%psk%%psa%0%ps2%%psn%$
::提取最大的单张,2张,3张,4张
for /l %%a in (3,1,17) do set pss!p6ss:~%%a,1!=%%a
::单牌
if %p6zs% == 1 set px=一张!ps:~%pss1%,1!&set p6yx=%pss1%
::3张和飞机
::解释: %p6ss:3=.% == %p6ss% 表示%p6ss%中没有3则if生效,加上not表示有3则if生效
if %p6zs% == 3 if not %p6ss:3=.% == %p6ss% set px=三张!ps:~%pss3%,1!
if %p6zs% == 4 if not %p6ss:3=.% == %p6ss% set px=三张!ps:~%pss3%,1!带一张!ps:~%pss1%,1!
if %p6zs% == 5 if not %p6ss:3=.% == %p6ss% if not %p6ss:2=.% == %p6ss% set px=三张!ps:~%pss3%,1!带一对!ps:~%pss2%,1!
if %p6zs% == 6 if not %p6ss:33=.% == %p6ss% set px=飞机
if %p6zs% == 8 if not %p6ss:33=.% == %p6ss% set px=飞机带单
if %p6zs% == 10 if not %p6ss:33=.% == %p6ss% if %p6ss:1=.% == %p6ss% set px=飞机带对
if %p6zs% == 9 if not %p6ss:333=.% == %p6ss% set px=三顺
if %p6zs% == 12 if not %p6ss:333=.% == %p6ss% set px=三顺带单
if %p6zs% == 15 if not %p6ss:333=.% == %p6ss% if %p6ss:1=.% == %p6ss% set px=三顺带对
if %p6zs% == 12 if not %p6ss:3333=.% == %p6ss% set px=三大顺
if %p6zs% == 16 if not %p6ss:3333=.% == %p6ss% set px=三大顺带单
::为防止出现类似333444555666777qqqkkkaa被误认为三大顺带对加入下面一行
set p6ss3=%p6ss:3333=.%
if %p6zs% == 20 if not %p6ss:3333=.% == %p6ss% if %p6ss:1=.% == %p6ss% if %p6ss3:3=.% == %p6ss3% set px=三大顺带对
if %p6zs% == 15 if not %p6ss:33333=.% == %p6ss% set px=三巨顺
if %p6zs% == 20 if not %p6ss:33333=.% == %p6ss% set px=三巨顺带单
if %p6zs% == 18 if not %p6ss:333333=.% == %p6ss% set px=三神顺
::对子和兄弟
if %p6zs% == 2 if %p6ss:1=.% == %p6ss% set px=一对!ps:~%pss2%,1!&set p6yx=%pss2%
if %p6zs% == 6 if not %p6ss:222=.% == %p6ss% set px=3兄弟
if %p6zs% == 8 if not %p6ss:2222=.% == %p6ss% set px=4兄弟
if %p6zs% == 10 if not %p6ss:22222=.% == %p6ss% set px=5兄弟
if %p6zs% == 12 if not %p6ss:222222=.% == %p6ss% set px=6兄弟
if %p6zs% == 14 if not %p6ss:2222222=.% == %p6ss% set px=7兄弟
if %p6zs% == 16 if not %p6ss:22222222=.% == %p6ss% set px=8兄弟
if %p6zs% == 18 if not %p6ss:222222222=.% == %p6ss% set px=9兄弟
if %p6zs% == 20 if not %p6ss:2222222222=.% == %p6ss% set px=10兄弟
::顺子
if %p6zs% == 5 if not %p6ss:11111=.% == %p6ss% set px=5张顺子
if %p6zs% == 6 if not %p6ss:111111=.% == %p6ss% set px=6张顺子
if %p6zs% == 7 if not %p6ss:1111111=.% == %p6ss% set px=7张顺子
if %p6zs% == 8 if not %p6ss:11111111=.% == %p6ss% set px=8张顺子
if %p6zs% == 9 if not %p6ss:111111111=.% == %p6ss% set px=9张顺子
if %p6zs% == 10 if not %p6ss:1111111111=.% == %p6ss% set px=10张顺子
if %p6zs% == 11 if not %p6ss:11111111111=.% == %p6ss% set px=11张顺子
if %p6zs% == 12 if not %p6ss:111111111111=.% == %p6ss% set px=12张顺子
::炸弹
if %p6zs% == 4 if not %p6ss:4=.% == %p6ss% set px=4炸!ps:~%pss4%,1!&set p6yx=%pss4%
if %p6zs% == 2 if not %p6ss:2$=.% == %p6ss% set px=王炸&set p6yx=%pss2%
::提取有效牌(顺子和兄弟里的最大一张,3张里的不含带牌的最大一张)
if not %px:顺子=.% == %px% set p6yx=%pss1%
if not %px:兄弟=.% == %px% set p6yx=%pss2%
if not %px:三=.% == %px% set p6yx=%pss3%
SYBC 1146830您出的牌: ; ;:115683C%px%
if "%px%" == "违规" (set p2s=%p2sBF%&&set p2h=%p2hBF%&&set p2y=%p2yBF%&&set p2z=%p2zBF%
for /l %%a in (1,1,20) do set p2w%%a=0
call :p11
SYBC 1166830不能这样出.;请重新出牌!
goto :GB)
(ECHO.fB800:%DEBUGQK:;= 20 3e&ECHO.fB800:% 20 3e&ECHO.q%)|DEBUG>NUL
for /l %%a in (1,1,%P6z%) do set /a wz=11220+%%a*3&&call :pa !wz! !p6y:~%%a,1! !p6s:~%%a,1! !p6h:~%%a,1! %p6js%
for /l %%a in (1,1,20) do set p2w%%a=0
sybc 1035030 ▁▁▁▁▁▁ ;$03▉$30 ▏;$03▉$3e 俺要不起!$30▏;$03▉$3e $30╲; $03▇▇▇▇▇▇▇
sybc 1071330 ▁▁▁▁▁▁ ;$03▉$30 ▏;$03▉$3e 俺要不起!$30▏;╱$3e $30▏;$03▇▇▇▇▇▇▇$30
if %p6z% == %p2zBF% goto :win
call :p11
SYBC 11606ce ;:11606ce%p2z%
SYBC 1166830没人要得起.;请继续出牌!
goto :GB
:p1
if "%2" == "" goto :P11
set /a sx0=11808+%2*3,sx1=12408+%2*3
if %1 == 0 sybc %sx0%3e
if %1 == 1 sybc %sx1%3e
:P11
(echo.FB800:B40 FFF 20 3E&echo q)|DEBUG>NUL
for /l %%a in (1,1,%p2z%) do set /a wz=11908+%%a*3,pz=%%a+1&(if !p2w%%a! == 1 set /a wz=!wz!-100)&call :pa !wz! !p2y:~%%a,1! !p2s:~%%a,1! !p2h:~%%a,1! 农 民
goto :eof
:pl
set pl=%2
for %%a in (0,1,20) set /a pq1=%%a*7+5,pq2=%%a*7+6 &&call :pa %1
goto :eof
:pb
sybc %1%pkBK3%▄▄▄▄▄;%pkbk% %pkNB% {\__/} %pkBK% ; %pkNB% / $fc@@%pkNB% \ %pkBK% ; %pkNB%( ($f0oo%pkNB%) )%pkBK% ; %pkNB% / ~~ \ %pkBK%
set /a pbw=%1+500
sybc %pbw%%pkbk% $f2斗 地 主%pkbk% ;%pkBK4%▄▄▄▄▄%pkBK%
goto :eof
:pa
if not "%4" == "" sybc %1%pkBK% ▄▄▄▄ ; $f%2%3%pkNB% %pkBK% ; $f%2%4%pkNB% %5 %pkBK% ; %pkNB% %6 $f%2%4%pkBK% ; %pkNB% $f%2%3%pkBK% ; %pkBK2%▄▄▄▄%pkBK%
goto :eof
:fp
title 发牌中...
for /l %%a in (1,1,20) do set p2w%%a=0
set /a p1z=17,p2z=17,p3z=17
set paid=
set paif=
set paiy=
:FP1
set /a pran+=1,m=0,n=0,d=0
::随机排序54张牌(洗牌)
for %%a in (3 4 5 6 7 8 9 0 J Q K A 2) do (for %%b in (!pkh1!-!pky0! !pkh2!-!pky0! !pkh3!-!pky1! !pkh4!-!pky1!) do (set p%pran%#!random!!random!.%%a-%%b=1))
set P%pran%#!random!!random!.N-!pkh0!-!pky1!=1
set P%pran%#!random!!random!.N-!pkh0!-!pky0!=1
::发牌,并留三张底
set he1=
set he2=
set he3=
set Di=
for /f "tokens=2 delims==." %%a in ('set p%pran%#') do (
set /a m=m%%3+1,n+=1
if !n! leq 51 (
for %%c in (!m!) do (
set he%%c=!he%%c! %%a
)
) else (set di=!di! %%a)
)
echo .%di%. >>d.txt
set pdi1s=!di:~1,1!
set pdi1h=!di:~3,1!
set pdi1y=!di:~5,1!
set pdi2s=!di:~7,1!
set pdi2h=!di:~9,1!
set pdi2y=!di:~11,1!
set pdi3s=!di:~13,1!
set pdi3h=!di:~15,1!
set pdi3y=!di:~17,1!
::整理各家手上的牌
for /l %%a in (1,1,3) do (
for %%b in (!he%%a!) do (
for /f "tokens=1,2,3 delims=-" %%c in ("%%b") do (
set pd%pran%#%%c=!pd%pran%#%%c!%%c
set pf%pran%#%%c=!pf%pran%#%%c!%%d
set py%pran%#%%c=!py%pran%#%%c!%%e
)
)
for %%b in (3 4 5 6 7 8 9 0 J Q K A 2 N) do (
set paid%pran%#=!paid%pran%#!!pd%pran%#%%b!
set paif%pran%#=!paif%pran%#!!pf%pran%#%%b!
set paiy%pran%#=!paiy%pran%#!!py%pran%#%%b!
)
for /f "tokens=1,2,3 delims=." %%b in ("!paid%pran%#!.!paif%pran%#!.!paiy%pran%#!") do (
set p%%as=0%%b
set p%%ah=0%%c
set p%%ay=0%%d
)
)
if "%pdi3s%" == "" goto FP
goto :eof
:timec
IF "%t1%" == "" EXIT /B 0
FOR /F "DELIMS=:. TOKENS=1,2,3,4" %%N IN ("%t1%") DO SET O=1%%O&SET P=1%%P&SET Q=1%%Q&SET /A N=100+%%N
IF "%t2%" == "" SET /A T=N*360000+O*6000+P*100+Q-36610100&&EXIT /B !T!
FOR /F "DELIMS=:. TOKENS=1,2,3,4" %%M IN ("%t2%") DO SET I=1%%N&SET J=1%%O&SET K=1%%P&SET /A H=100+%%M
IF "%t2%" GTR "A" (SET L=%t2%&SET /A T=N*360000+O*6000+P*100+Q-36610100,S=T/100,M=T/6000,H=T/360000) ELSE (SET L=%3&SET /A H=H-N,I=I-O,J=J-P,K=K-Q,T=H*360000+I*6000+J*100+K,S=T/100,M=T/6000,H=T/360000)
IF "%L%" == "" SET L=T
sybc 1176831耗时: 厘秒;:11773$3c!%L%!
goto :eof
|