中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-19 18:44
47,814 topics / 349,908 posts / today 0 new / 48,259 members
DOS批处理 & 脚本技术(批处理室) » [Original] Gobang Man-machine Battle Batch Game
Printable Version  14,359 / 73
Floor1 netbenton Posted 2009-05-05 12:41
银牌会员 Posts 752 Credits 1,916 From 广西
This batch script took me two days, so I marked it as original.
I also posted this batch script on Batch Processing Home. If there is any similarity with other posts, it's purely coincidental.
Welcome everyone to point out mistakes, thank you.


Post 41
Added background music "Spring River Flowers and Moonlight", a sound like flowing water on a mountain, it's so cool to play Go while listening, including the playback code and music file is only 96K.


Mouse operation version
Post 50
Latest at post 60 2009.8.1





Floor2 sexfio Posted 2009-05-05 12:47
社区乞丐 Posts 45 Credits -27
That's wonderful. It would be great if there was a VBS version, because I don't understand batch processing very well.

Put forward a suggestion: Make the chessboard larger, use red and yellow for the chess pieces, make the text smaller, and there's a misalignment between the column numbers and the lines.

Also, the computer's first move was absurd. I played in the center, and it went to the side and placed one piece there.

[ Last edited by sexfio on 2009-5-5 at 12:49 ]
Floor3 netbenton Posted 2009-05-05 12:55
银牌会员 Posts 752 Credits 1,916 From 广西
To make it red and yellow, three parties need to be used. Let's make do with it!

If it's for a better display, I'm preparing to improve it. If we need to add more rows and columns, there's no need. It takes quite a while to finish a game (a draw) with 19x19.

For Gobang, it's not necessary for the pieces to be together. As long as five are in a row, it's a win. With just one piece, the computer doesn't need to block immediately.

After reading some Gobang materials, I found that I solved too few Gobang pieces.
This batch processing chess skill is really too low.

[ Last edited by netbenton on 2009-5-10 at 08:38 ]
Floor4 provem Posted 2009-05-05 22:05
初级用户 Posts 82 Credits 92
It is suggested to use a third - party tool to support the mouse in CMOS.
Floor5 jmz573515 Posted 2009-05-06 08:54
银牌会员 Posts 464 Credits 1,212
Floor6 wishpopo Posted 2009-05-06 10:02
新手上路 Posts 20 Credits 18
Not bad. I didn't expect that the intelligence of the computer could be designed like this. Learned it.
Floor7 netbenton Posted 2009-05-06 10:23
银牌会员 Posts 752 Credits 1,916 From 广西
In response to a comment from user 2, the chessboard has been enlarged.
At the same time, a move - undo function has been added, sound effects have been added, the system prompt has been placed in a more reasonable place, and a little bit of chess - playing skill for the computer side has been increased, and a special display for the computer side's last move has been added.

May 10 modification: Fixed that black pieces go first, and the first move is fixed to be placed at the Tianyuan position JJ10.

May 17 modification: Enhanced the computer's IQ.

May 21 modification: Perfected the computer's IQ, and when there are multiple equivalent positions, it selects positions randomly. The playability has been improved, and also because of the randomness, so players don't necessarily win against the computer, and the computer doesn't necessarily win.

June 2 minor modification.

Floor8 yishanju Posted 2009-05-06 16:59
银牌会员 Posts 1,357 Credits 1,488
Really, really beautiful, it's stunning
Floor9 zh159 Posted 2009-05-07 13:53
金牌会员 Posts 1,467 Credits 3,687
It is suggested to convert this algorithm to VBS or JS, which can be used in HTA, support mouse clicks, and the interface will be more beautiful
Floor10 netbenton Posted 2009-05-08 02:13
银牌会员 Posts 752 Credits 1,916 From 广西
re 9th floor
I don't have an in-depth understanding of VBS. Anyone who is interested can write it.

In fact, making a Gobang game is not difficult. With other languages, there are already quite beautiful Gobang games. It's just that some skills are needed when doing it in pure batch. But there is one point, no matter how good it is made, it can't compare with the real graphical interface.


re 4th floor

I also thought about using third parties to support mouse operation, but this game is only a few KB. If I use a third party of hundreds of KB for mouse operation, I don't think it's cost-effective. If it can be done with VBS, JS, or other system-built-in scripting languages, then it's almost okay.

Using the keyboard has the advantages of using the keyboard. You can unconsciously practice blind typing while playing.
Floor11 everest79 Posted 2009-05-08 12:00
金牌会员 Posts 1,127 Credits 2,564
There is nothing to translate here as the input is in Chinese but the content is just "有空讲解下,我都看不懂" which translates to "There is time to explain, I can't understand it all". But since the task is to just return the translated text as is, and in this case the English translation is "There is time to explain, I can't understand it all" but let's just present it directly:

There is time to explain, I can't understand it all
Floor12 zh159 Posted 2009-05-08 12:20
金牌会员 Posts 1,467 Credits 3,687
Got some free time to explain an algorithm and see how to convert it to VBS?
Floor13 netbenton Posted 2009-05-08 14:26
银牌会员 Posts 752 Credits 1,916 From 广西
::The algorithm takes advantage of the variable names being changeable in batch processing. When defining and using variables, the variable name is also part of the data. I wonder if VBS can do this in the same way.

::Comments have been added in the main places.
Floor14 sady2009 Posted 2009-05-08 22:32
初级用户 Posts 60 Credits 58
It's too complicated. I've used up tens of thousands of brain cells and still don't understand it. :D
Floor15 zh159 Posted 2009-05-09 13:27
金牌会员 Posts 1,467 Credits 3,687
Haven't had time to figure out the algorithm yet, let's first create an HTA interface.



1 2 3 45  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023