China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 00:00
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » DouDiZhu script, under development... Mouse test version updated [2010-4-23] View 5,781 Replies 45
Floor 16 Posted 2010-03-06 16:34 ·  中国 北京 联通
中级用户
★★
Credits 499
Posts 225
Joined 2008-12-30 22:09
17-year member
UID 135392
Gender Male
Status Offline
The new version of sybc 1.1.21 has supported the choice function. The new version of Dou Di Zhu (Landlord) synchronously supports using sybc for direction key control. The latest screenshots have been updated on the first floor.
SYBNQQ:354324773
Floor 17 Posted 2010-03-07 09:43 ·  中国 吉林 通化 联通
新手上路
Credits 19
Posts 10
Joined 2010-03-03 11:01
16-year member
UID 161490
Gender Male
Status Offline
Not bad, heh heh.
If it succeeds, I must take a look.
Floor 18 Posted 2010-03-07 21:26 ·  中国 福建 泉州 石狮市 电信
银牌会员
★★★
Credits 1,276
Posts 469
Joined 2002-12-23 13:00
23-year member
UID 586
Gender Male
From 福建泉州
Status Offline
Is there any one released to try? It feels so powerful.
QQ:366840202
http://chenall.net
Floor 19 Posted 2010-03-08 11:07 ·  中国 北京 联通
中级用户
★★
Credits 499
Posts 225
Joined 2008-12-30 22:09
17-year member
UID 135392
Gender Male
Status Offline
Currently there is only a front - end interface, and it can't play cards at all!
But if you need the current version for research,
Join the group: 3401238 and ask me for it!
SYBNQQ:354324773
Floor 20 Posted 2010-03-08 11:42 ·  中国 重庆 电信
中级用户
★★
我是DOS学者
Credits 367
Posts 180
Joined 2006-05-14 10:53
20-year member
UID 55507
Gender Male
From 重庆
Status Offline
So powerful, spiritual support~~
Floor 21 Posted 2010-03-10 13:35 ·  中国 北京 联通
中级用户
★★
Credits 499
Posts 225
Joined 2008-12-30 22:09
17-year member
UID 135392
Gender Male
Status Offline
I'm currently writing the front-end code for playing cards, and it doesn't verify if it's against the rules at the moment, and the computer won't play cards for the time being!
SYBNQQ:354324773
Floor 22 Posted 2010-03-13 20:44 ·  中国 北京 联通
中级用户
★★
Credits 499
Posts 225
Joined 2008-12-30 22:09
17-year member
UID 135392
Gender Male
Status Offline
Embedded card pattern detection, when a player plays a card, they will get a prompt:
If the card play conforms to the rules, it will prompt the card set it is in. [For example, the screenshot prompts 3 sevens with a pair of 4]
If the card play does not conform to the rules, it will prompt "illegal!"
Attachments
ddz59.GIF
SYBNQQ:354324773
Floor 23 Posted 2010-03-14 12:34 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
What is the conversion relationship between centiseconds and seconds?
Floor 24 Posted 2010-03-14 17:48 ·  中国 河北 廊坊 联通
中级用户
★★
Credits 499
Posts 225
Joined 2008-12-30 22:09
17-year member
UID 135392
Gender Male
Status Offline
SYBNQQ:354324773
Floor 25 Posted 2010-03-14 17:53 ·  中国 河北 廊坊 联通
中级用户
★★
Credits 499
Posts 225
Joined 2008-12-30 22:09
17-year member
UID 135392
Gender Male
Status Offline
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
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
qinchun36 +4 2010-03-18 00:43
SYBNQQ:354324773
Floor 26 Posted 2010-03-16 17:30 ·  中国 河北 廊坊 联通
中级用户
★★
Credits 499
Posts 225
Joined 2008-12-30 22:09
17-year member
UID 135392
Gender Male
Status Offline
Compressed part of the code, sacrificed readability, improved a little speed!
SYBNQQ:354324773
Floor 27 Posted 2010-03-20 14:36 ·  中国 河北 廊坊 联通
中级用户
★★
Credits 499
Posts 225
Joined 2008-12-30 22:09
17-year member
UID 135392
Gender Male
Status Offline
Found a new collaborator PLP. This is in the plan to organize and rewrite the code
SYBNQQ:354324773
Floor 28 Posted 2010-03-20 15:13 ·  中国 河北 廊坊 联通
中级用户
★★
Credits 499
Posts 225
Joined 2008-12-30 22:09
17-year member
UID 135392
Gender Male
Status Offline
```batch
@echo off&SETLOCAL ENABLEDELAYEDEXPANSION&(CHCP 437 &GRAFTABL 936)>NUL
:: Variable initialization
:: The cards for players 1-3 are uniformly used with P1XXX-p3XXX variables, P4XXX is reserved. The cards played by players are uniformly used with P5XXX-P6XXX, P7XXX is reserved, and P0XXX is for temporary needs.
:: Variables related to poker cards are uniformly used with PKXXX
:: PKSXX represents the corresponding values of each point card and character: pks11=J, pks12=Q
:: PKHX represents the corresponding values of each suit number and character: pkh1= (heart), pkh0=T (king)
:: PKYX represents the corresponding values of each color number and character: Poker has only 2 colors, red and black. pky0=c (red), pky1=0 (black) (same as the color command)
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;BK=$7f;BK2=$f7;BK3=$37;BK4=$73;NB=$f1;p=1
set pk%a:;=&set pk%
:: Load/generate sybc variable SYBCOM saves the hexadecimal data of SYBC, V saves DEBUG code, and finally is executed by DEBUG through the pipe
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
:: Save the coordinates of the refresh block, the middle part of the game interface (the position to play cards). Each time partial refresh is needed, the variable DEBUGQK saves the start and end addresses of the memory to be refreshed
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
:: Initial information
color 3e
echo Dou Di Zhu {Comment Version} 2010-3-20
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 poker Space Play card
echo.
echo Press any key to start...
sybc
:2
:: Call the deal card module
call :FP
:1
:: Variable CBXX is uniformly used for color background information
set cB0=$f
cls
:: Timing 1
set t1=%time%
:: Display the top bar
sybc 10000%cB0%0 :::│%cB0%c Score%cB0%9 Left computer %cB0%00 %cB0%2+0%cB0%c=%cB0%00 %cB0%0│%cB0%c Dou Di Zhu V0.0  %cB0%0│%cB0%0 %cB0%0│ Bottom cards │:::
sybc 10100%cB0%0 ::│%cB0%c Points%cB0%9 Right computer %cB0%00 %cB0%2+0%cB0%c=%cB0%00 %cB0%0│%cB0%9Developed: SYBN netbenton plp %cB0%0│%cB0%9 Left computer %cB0%0│ │::
sybc 10200%cB0%0 :│%cB0%c Ranking%cB0%9 Player SYBN %cB0%00 %cB0%2+0%cB0%c=%cB0%00 %cB0%0│%cB0%22010-3-20  Press F1 to view help%cB0%0│%cB0%d Call score 3 points %cB0%0│ │:
sybc 10168%cB0%%pdi1y%%pdi1s% %cB0%%pdi2y%%pdi2s% %cB0%%pdi3y%%pdi3s%;%cB0%%pdi1y%%pdi1h% %cB0%%pdi2y%%pdi2h% %cB0%%pdi3y%%pdi3h%
:: Display the back of the computer's cards
call :pb 10701
call :pb 10769
:: Display the name boxes of 3 people
sybc 10300$4c☉$4c▄▄▄▄$4c☉;$c4▌$c9 Left computer $4c▌;$c4▌$ce Remaining cards 11 pieces $4c▌;$4c☉$c4▄▄▄▄$4c☉
sybc 10368$4c☉$4c▄▄▄▄$4c☉;$c4▌$c9 Right computer $4c▌;$c4▌$ce Remaining cards 7 pieces $4c▌;$4c☉$c4▄▄▄▄$4c☉
sybc 11400$4c☉$4c▄▄▄▄$4c☉;$c4▌$c9 Player SYBN$4c▌;$c4▌$ce Remaining cards 17 pieces $4c▌;$4c☉$c4▄▄▄▄$4c☉
:: P11 displays the player's cards
call :p11
:: Timing 2
set t2=%time%
:: Calculate the time difference and display
call :timec
:GB
title Please choose the cards you want to play...
:: Initialize the card selection pointer, variable GBy is the original pointer position
set /a GBy=12212,GBs=1
:GB1
:: Locate the card selection pointer, variable GBW is the new pointer position
set /a GBW=12209+GBs*3
:: Display the card selection pointer and erase the original pointer
sybc %GBy%f1 ;:%GBw%f1↑
:: The SYBC function without parameters is similar to CHOICE, pauses the script and gets a key
sybc
:: Next line, display the pressed key
::title sybc-%errorlevel%-
:: Perform corresponding operations according to different keys
:: Left and right arrows move the cursor
if %errorlevel% == 75 set /a GBs-=1
if %errorlevel% == 77 set /a GBs+=1
:: Up and down arrows raise/lower the poker and refresh the player's cards
if %errorlevel% == 72 set /a p2w%GBs%=1&&call :p11 1 %GBs%
if %errorlevel% == 80 set /a p2w%GBs%=0&&call :p11 0 %GBs%
:: Space bar Play card
if %errorlevel% == 57 goto chupai
:: F2 Re-deal cards
if %errorlevel% == 60 goto 2
:: F5 Refresh
if %errorlevel% == 63 goto 1
:: If the pointer exceeds the high and low limits, restore
if %GBs% lss 1 set gbs=%p2z%
if %GBs% gtr %p2z% set gbs=1
:: Save the original pointer for erasing
set /a GBy=GBw
goto :GB1
```
SYBNQQ:354324773
Floor 29 Posted 2010-03-21 12:30 ·  中国 黑龙江 哈尔滨 联通
版主
★★
系统收藏家
Credits 326
Posts 285
Joined 2010-02-22 00:00
16-year member
UID 160972
Gender Male
From 黑龙江省
Status Offline
Why don't you use my suggestion?
Floor 30 Posted 2010-03-24 12:37 ·  中国 河北 廊坊 联通
中级用户
★★
Credits 499
Posts 225
Joined 2008-12-30 22:09
17-year member
UID 135392
Gender Male
Status Offline
The F1 help has been adopted. It's just that I can't write about Dou Di Zhu (Chinese poker game) for the time being because there's no AI, and I've rewritten other games! In the new game, F1 is already the help!
http://www.cn-dos.net/forum/viewthread.php?tid=50583&fpage=1
SYBNQQ:354324773
Forum Jump: