中国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-11-23 02:40
47,820 topics / 349,938 posts / today 0 new / 48,298 members
DOS批处理 & 脚本技术(批处理室) » [Original] Gobang Man-machine Battle Batch Game
Printable Version  15,876 / 73
Floor31 everest79 Posted 2009-05-12 08:42
金牌会员 Posts 1,127 Credits 2,564
First, write something simple to set up the framework, and then gradually make it more complex. Hehe
Floor32 netbenton Posted 2009-05-12 13:57
银牌会员 Posts 752 Credits 1,916 From 广西
Added a few lines of code, but it improved a lot in speed.

It seems that it is still possible to further improve the computer's chess playing ability,
and introduce the forbidden moves and other rules of Gobang,


Floor33 netbenton Posted 2009-05-17 11:44
银牌会员 Posts 752 Credits 1,916 From 广西
Enhanced the intelligence of the computer side!
Updated on floor 7 already.
Floor34 matlan Posted 2009-05-17 14:22
初级用户 Posts 63 Credits 87
Floor35 516526966 Posted 2009-05-18 03:02
初级用户 Posts 37 Credits 63
It's really incredible, very spectacular,, admire you, you're really a good person...

[ Last edited by 516526966 on 2009-5-18 at 08:03 ]

Attachments
2009-05-18_185017.png (25.14 KiB)
Floor36 zh159 Posted 2009-05-18 13:07
金牌会员 Posts 1,467 Credits 3,687
I'm completely confused. Except for the interface, I'm a total novice to the Budget Law, and changing to VBS is basically out of the question...
Floor37 277854201 Posted 2009-05-19 04:20
新手上路 Posts 1 Credits 1
Floor38 netbenton Posted 2009-05-21 09:09
银牌会员 Posts 752 Credits 1,916 From 广西
There has been another update, improving the computer's IQ, and randomly selecting positions when there are multiple equivalent points that can be played, increasing the playability. Therefore, this batch script is no longer just a work of art but also a real Gobang game. Welcome everyone to use it, and post the places where you think the computer plays "stupidly" so that it can be improved again.

Final update, please see floor 7
Floor39 zh159 Posted 2009-05-22 23:31
金牌会员 Posts 1,467 Credits 3,687
The two algorithms I now want to figure out:
1. Lower computer algorithm of the computer
2. Algorithm for the result of five-in-a-row
Floor40 netbenton Posted 2009-05-23 00:55
银牌会员 Posts 752 Credits 1,916 From 广西
re 39L

Array definition:
1. Display buffer
2. Horizontal (string length is 19)
3. Vertical (string length is 19)
4. Diagonal (slash, string length is 5~19~5)
5. Diagonal (backslash, string length is 5~19~5)

Array 1 is initially an empty chessboard.
Arrays 2~5 are initially strings of all #.

When there is a move, according to the player's input or the actual coordinates obtained by the computer, replace the corresponding positions in the 5 arrays with the chess piece (method:!str:~,n!chess piece!str:~n+1!). Immediately after replacement, match whether the string!str! contains five in a row, and if so, the player wins.

How the computer takes the position:
Because each direction string is defined and updated separately, just match the various rule strings (that is, set IQ, such as #○○○#) with the data strings in each direction. If found, record it (in which array, which string). After all matching is completed, analyze the recorded results and convert them into actual coordinates.

(The number after the IQ rule string is the available point in the rule string. Calculate the position of the rule string in the direction string. According to this point, the available point in the direction string can be calculated. Then, according to which array it is in, the available point in the actual coordinates can be calculated.)

Then weight the coordinates according to the rule string (in the initial version, only the first matched available point is sought, and the weight calculation is not done). Finally, the computer takes the coordinate with the largest weight value to make a move. If there are equal weights, randomly take one.
Floor41 netbenton Posted 2009-05-25 11:39
银牌会员 Posts 752 Credits 1,916 From 广西
Gobang batch processing, with music playback and music files, only 96K
Listening to "Moonlit Night on the Spring River" while playing chess, enjoy it!!

[ Last edited by netbenton on 2009-6-3 at 23:22 ]

Attachments
五子棋(音乐版).rar (20.18 KiB)
Floor42 netbenton Posted 2009-06-02 12:01
银牌会员 Posts 752 Credits 1,916 From 广西
Minor update: Slightly enhanced the computer's chess-playing skill.
(Updated on floors 7 and 41)

Saw someone online post that when the player goes first, they can win the computer in nine moves, so this has been improved.
Floor43 THENEWLIFE Posted 2009-06-02 22:53
初级用户 Posts 64 Credits 78
After seeing the masterpiece of the senior, my heart has been in turmoil for a long time. When will I be able to reach the level of the senior?
I will work hard from today! Work hard! Aim at the senior
Floor44 tslnyys Posted 2009-06-03 02:34
初级用户 Posts 17 Credits 29
The music doesn't stop. The batch script is closed but the music continues.
Floor45 tslnyys Posted 2009-06-03 02:36
初级用户 Posts 17 Credits 29
Oh, only when you type Q to exit in the game will the music stop.

If you directly click the close button, the game exits but the music continues to play.

I don't know if it's only like this for me.
Prev  1 2 3 4 5  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023