Computer Hope

Microsoft => Microsoft DOS => Topic started by: xdao on August 16, 2008, 09:08:07 PM

Title: gobang
Post by: xdao on August 16, 2008, 09:08:07 PM
two player play it     
Code: [Select]
@echo off

mode con cols=48 lines=23
color f0
set ab=  ┏━━━━━━━━━━━━━━━━━━━━┓
set ac=  ┃   1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9┃
set a=  ┃A ┌┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┐┃
set b=  ┃B ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set c=  ┃C ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set d=  ┃D ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set e=  ┃E ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set f=  ┃F ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set g=  ┃G ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set h=  ┃H ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set i=  ┃I ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set j=  ┃J ├┼┼┼┼┼┼┼┼╋┼┼┼┼┼┼┼┼┤┃
set k=  ┃K ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set l=  ┃L ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set m=  ┃M ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set n=  ┃N ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set o=  ┃O ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set p=  ┃P ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set q=  ┃Q ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set r=  ┃R ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set s=  ┃S └┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┘┃
set ad=  ┗━━━━━━━━━━━━━━━━━━━━┛
set shu=0
:start
echo %ab%
echo %ac%
echo %a%
echo %b%
echo %c%
echo %d%
echo %e%
echo %f%
echo %g%
echo %h%
echo %i%
echo %j%
echo %k%
echo %l%
echo %m%
echo %n%
echo %o%
echo %p%
echo %q%
echo %r%
echo %s%
echo %ad%

set qi=
set /p qi=输入要下棋的位置 如:10j   
if "%qi%"=="" goto start

set lie=%qi:~0,-1%
set /a u=%lie%+4
set /a v=%lie%+5
set hang=%qi:~-1%
if %shu%==0 set sai=●
if %shu%==1 set sai=○
call set zi=%%%hang%:~%u%,1%%

if %lie% geq 1 (
if %lie% leq 19 (


if "%zi%"=="●" goto start
if "%zi%"=="○" goto start

call set %hang%=%%%hang%:~0,%u%%%%sai%%%%hang%:~%v%%%

for %%i in (0 1 2 3 4 5 6 7 8 9 t u v w x y z) do if %hang%==%%i goto start


if %shu%==0 (
set shu=1
) else (
set shu=0
)
)
)

goto start
Title: Re: gobang
Post by: Carbon Dudeoxide on August 16, 2008, 10:06:16 PM
I don't get it......are you showing it to us or do you have a problem with it?
Title: Re: gobang
Post by: qinghao on August 17, 2008, 06:55:32 AM
It is a game,a chess game for two person to play.
As known as gobang chess.
Title: Re: gobang
Post by: patio on August 17, 2008, 08:54:18 AM
Fascinating...
Title: Re: gobang
Post by: Carbon Dudeoxide on August 17, 2008, 08:57:58 AM
.....how do I get it to work?
Title: Re: gobang
Post by: qinghao on August 17, 2008, 03:34:41 PM
copy all lines in the code area ,
save it as a batch file(.bat)
run it
there is a prompt to tel you to input the location(like coordinates) where place the chess pieces.
the prompt is in Chinese.
I tried to translate it into English(as follows):
Chinese:
Code: [Select]
set /p qi=输入要下棋的位置 如:10j    English:
Code: [Select]
set /p qi=Please input the location of chess like:10j
enjoy it!a batch file game.
Title: Re: gobang
Post by: Carbon Dudeoxide on August 17, 2008, 08:43:44 PM
Hmmmm......Doesn't work for me.

This is what I get:
(http://www.fileupyours.com/files/185178/untitled.JPG)

When I enter something, it closes.
Title: Re: gobang
Post by: patio on August 19, 2008, 11:23:52 AM
Told ya it was fascinating...
Title: Re: gobang
Post by: qinghao on August 19, 2008, 11:59:15 AM
xdao,I know this guy.
this batch work OK on my computer because of that both xdao and me are use
SC(Simplified Chinese) Windows.
the batch is design under the Chinese environment
Title: Re: gobang
Post by: Carbon Dudeoxide on August 19, 2008, 08:47:25 PM
Hmmmm.....that's a problem then.

I know at my dads office they have Chinese computers. I will have to try there.
Title: Re: gobang
Post by: CBMatt on August 19, 2008, 10:40:02 PM
Anyone else find this a bit odd?
Title: Re: gobang
Post by: Carbon Dudeoxide on August 19, 2008, 10:50:33 PM
How so?
Title: Re: gobang
Post by: CBMatt on August 19, 2008, 10:54:41 PM
It just strikes me as odd that someone would register for the sole purpose of posting a batch game.
Title: Re: gobang
Post by: qinghao on August 20, 2008, 12:17:13 AM
The source code of this game  is given,you can learn teh batch file grammar from it.