Informal Release Dou Di Zhu (Landlord) No AI Test Version
Currently, it can be barely taken out for viewing, but there are still many things that need to be improved and modified.
Any opinions and suggestions are welcome to post a reply or join the QQ group: 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 Dou Di Zhu Test Version
echo.
echo Currently there is no AI, the computer will not play cards. You can play cards randomly, and the cards will be dealt automatically after playing.
echo.
echo Currently available keys and their functions:
echo F2 Re-deal cards F5 Refresh
echo Arrow keys Control cards Space Bar Play cards
echo.
echo Press any key to start...
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 Product%TITDS%9 Computer Left %TITDS%00 %TITDS%2+0%TITDS%c=%TITDS%00 %TITDS%0│%TITDS%c Dou Di Zhu V0.0 %TITDS%0│%TITDS%0 %TITDS%0│ Bottom Cards │:::
sybc 10100%TITDS%0 ::│%TITDS%c Score%TITDS%9 Computer Right %TITDS%00 %TITDS%2+0%TITDS%c=%TITDS%00 %TITDS%0│%TITDS%9 Developer: SYBN netbenton %TITDS%0│%TITDS%9 Computer Left %TITDS%0│ │::
sybc 10200%TITDS%0 :│%TITDS%c Rank%TITDS%9 Player SYBN %TITDS%00 %TITDS%2+0%TITDS%c=%TITDS%00 %TITDS%0│%TITDS%22010-3-13 Press F1 to view help%TITDS%0│%TITDS%d Call Score 3 points %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 Computer Left $4c▌;$c4▌$ce Remaining Cards 11张$4c▌;$4c☉$c4▄▄▄▄$4c☉
sybc 10368$4c☉$4c▄▄▄▄$4c☉;$c4▌$c9 Computer Right $4c▌;$c4▌$ce Remaining Cards 7张$4c▌;$4c☉$c4▄▄▄▄$4c☉
sybc 11400$4c☉$4c▄▄▄▄$4c☉;$c4▌$c9 Player SYBN$4c▌;$c4▌$ce Remaining Cards 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! Farmer
:for /l %%a in (4,1,12) do set /a wz=10800+%%a*3&&call :pa !wz! !pcy%%a! !pks%%a! !pch%%a! Landlord
set t2=%time%
call :timec
:GB
::title Please choose the cards you want to play...
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=Farmer) 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=Violation
set p6yx=0
::Mark the cards corresponding to the string
set ps=---34567890JQKA02N$
::Initialize
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
::Calculate the number of cards of each midpoint number
for /l %%a in (1,1,20) do for /f %%b in ("!p6s:~%%a,1!") do set /a ps%%b+=1
::Calculate the number of cards
set /a p6zs=%ps3%+%ps4%+%ps5%+%ps6%+%ps7%+%ps8%+%ps9%+%ps0%+%psj%+%psq%+%psk%+%psa%+%ps2%+%psn%
::Get the marked string %p6ss%
set p6ss=---%ps3%%ps4%%ps5%%ps6%%ps7%%ps8%%ps9%%ps0%%psj%%psq%%psk%%psa%0%ps2%%psn%$
::Extract the largest single card, 2 cards, 3 cards, 4 cards
for /l %%a in (3,1,17) do set pss!p6ss:~%%a,1!=%%a
::Single card
if %p6zs% == 1 set px=One!ps:~%pss1%,1!&set p6yx=%pss1%
::3 cards and planes
::Explanation: %p6ss:3=.% == %p6ss% means there is no 3 in %p6ss%, and if not, it means there is 3 in %p6ss%
if %p6zs% == 3 if not %p6ss:3=.% == %p6ss% set px=Three!ps:~%pss3%,1!
if %p6zs% == 4 if not %p6ss:3=.% == %p6ss% set px=Three!ps:~%pss3%,1! with one!ps:~%pss1%,1!
if %p6zs% == 5 if not %p6ss:3=.% == %p6ss% if not %p6ss:2=.% == %p6ss% set px=Three!ps:~%pss3%,1! with a pair!ps:~%pss2%,1!
if %p6zs% == 6 if not %p6ss:33=.% == %p6ss% set px=Plane
if %p6zs% == 8 if not %p6ss:33=.% == %p6ss% set px=Plane with single card
if %p6zs% == 10 if not %p6ss:33=.% == %p6ss% if %p6ss:1=.% == %p6ss% set px=Plane with pairs
if %p6zs% == 9 if not %p6ss:333=.% == %p6ss% set px=Three consecutive
if %p6zs% == 12 if not %p6ss:333=.% == %p6ss% set px=Three consecutive with single cards
if %p6zs% == 15 if not %p6ss:333=.% == %p6ss% if %p6ss:1=.% == %p6ss% set px=Three consecutive with pairs
if %p6zs% == 12 if not %p6ss:3333=.% == %p6ss% set px=Three large consecutive
if %p6zs% == 16 if not %p6ss:3333=.% == %p6ss% set px=Three large consecutive with single cards
::To prevent something like 333444555666777qqqkkkaa from being mistaken for three large consecutive with pairs, add the following line
set p6ss3=%p6ss:3333=.%
if %p6zs% == 20 if not %p6ss:3333=.% == %p6ss% if %p6ss:1=.% == %p6ss% if %p6ss3:3=.% == %p6ss3% set px=Three large consecutive with pairs
if %p6zs% == 15 if not %p6ss:33333=.% == %p6ss% set px=Three giant consecutive
if %p6zs% == 20 if not %p6ss:33333=.% == %p6ss% set px=Three giant consecutive with single cards
if %p6zs% == 18 if not %p6ss:333333=.% == %p6ss% set px=Three divine consecutive
::Pairs and brothers
if %p6zs% == 2 if %p6ss:1=.% == %p6ss% set px=One pair!ps:~%pss2%,1!&set p6yx=%pss2%
if %p6zs% == 6 if not %p6ss:222=.% == %p6ss% set px=3 brothers
if %p6zs% == 8 if not %p6ss:2222=.% == %p6ss% set px=4 brothers
if %p6zs% == 10 if not %p6ss:22222=.% == %p6ss% set px=5 brothers
if %p6zs% == 12 if not %p6ss:222222=.% == %p6ss% set px=6 brothers
if %p6zs% == 14 if not %p6ss:2222222=.% == %p6ss% set px=7 brothers
if %p6zs% == 16 if not %p6ss:22222222=.% == %p6ss% set px=8 brothers
if %p6zs% == 18 if not %p6ss:222222222=.% == %p6ss% set px=9 brothers
if %p6zs% == 20 if not %p6ss:2222222222=.% == %p6ss% set px=10 brothers
::Straight
if %p6zs% == 5 if not %p6ss:11111=.% == %p6ss% set px=5-card straight
if %p6zs% == 6 if not %p6ss:111111=.% == %p6ss% set px=6-card straight
if %p6zs% == 7 if not %p6ss:1111111=.% == %p6ss% set px=7-card straight
if %p6zs% == 8 if not %p6ss:11111111=.% == %p6ss% set px=8-card straight
if %p6zs% == 9 if not %p6ss:111111111=.% == %p6ss% set px=9-card straight
if %p6zs% == 10 if not %p6ss:1111111111=.% == %p6ss% set px=10-card straight
if %p6zs% == 11 if not %p6ss:11111111111=.% == %p6ss% set px=11-card straight
if %p6zs% == 12 if not %p6ss:111111111111=.% == %p6ss% set px=12-card straight
::Bomb
if %p6zs% == 4 if not %p6ss:4=.% == %p6ss% set px=4 bomb!ps:~%pss4%,1!&set p6yx=%pss4%
if %p6zs% == 2 if not %p6ss:2$=.% == %p6ss% set px=King bomb&set p6yx=%pss2%
::Extract valid cards (the largest one in straight and brothers, the largest one without the carrying card in three cards)
if not %px:Straight=.% == %px% set p6yx=%pss1%
if not %px:Brothers=.% == %px% set p6yx=%pss2%
if not %px:Three=.% == %px% set p6yx=%pss3%
SYBC 1146830The cards you played: ; ;:115683C%px%
if "%px%" == "Violation" (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 1166830Cannot play like this.;Please re-deal cards!
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 I can't take it! $30▏;$03▉$3e $30╲; $03▇▇▇▇▇▇▇
sybc 1071330 ▁▁▁▁▁▁ ;$03▉$30 ▏;$03▉$3e I can't take it! $30▏;╱$3e $30▏;$03▇▇▇▇▇▇▇$30
if %p6z% == %p2zBF% goto :win
call :p11
SYBC 11606ce ;:11606ce%p2z%
SYBC 1166830No one can take it.;Please continue to play cards!
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! Farmer
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% $f2Dou Di Zhu%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 Dealing cards...
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
::Randomly sort 54 cards (shuffle)
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
::Deal cards and leave three bottom cards
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!
::Organize the cards in each player's hand
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 1176831Elapsed time: centiseconds;:11773$3c!%L%!
goto :eof