Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: gobang  (Read 4200 times)

0 Members and 1 Guest are viewing this topic.

xdao

  • Guest
gobang
« 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

Carbon Dudeoxide

  • Global Moderator

  • Mastermind
  • Thanked: 169
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Experience: Guru
  • OS: Mac OS
Re: gobang
« Reply #1 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?

qinghao



    Intermediate
  • Don't think your self special
    Re: gobang
    « Reply #2 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.

    patio

    • Moderator


    • Genius
    • Maud' Dib
    • Thanked: 1769
      • Yes
    • Experience: Beginner
    • OS: Windows 7
    Re: gobang
    « Reply #3 on: August 17, 2008, 08:54:18 AM »
    Fascinating...
    " Anyone who goes to a psychiatrist should have his head examined. "

    Carbon Dudeoxide

    • Global Moderator

    • Mastermind
    • Thanked: 169
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Experience: Guru
    • OS: Mac OS
    Re: gobang
    « Reply #4 on: August 17, 2008, 08:57:58 AM »
    .....how do I get it to work?

    qinghao



      Intermediate
    • Don't think your self special
      Re: gobang
      « Reply #5 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.

      Carbon Dudeoxide

      • Global Moderator

      • Mastermind
      • Thanked: 169
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Experience: Guru
      • OS: Mac OS
      Re: gobang
      « Reply #6 on: August 17, 2008, 08:43:44 PM »
      Hmmmm......Doesn't work for me.

      This is what I get:


      When I enter something, it closes.

      patio

      • Moderator


      • Genius
      • Maud' Dib
      • Thanked: 1769
        • Yes
      • Experience: Beginner
      • OS: Windows 7
      Re: gobang
      « Reply #7 on: August 19, 2008, 11:23:52 AM »
      Told ya it was fascinating...
      " Anyone who goes to a psychiatrist should have his head examined. "

      qinghao



        Intermediate
      • Don't think your self special
        Re: gobang
        « Reply #8 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

        Carbon Dudeoxide

        • Global Moderator

        • Mastermind
        • Thanked: 169
          • Yes
          • Yes
          • Yes
        • Certifications: List
        • Experience: Guru
        • OS: Mac OS
        Re: gobang
        « Reply #9 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.
        « Last Edit: August 19, 2008, 10:50:27 PM by Carbon Dudeoxide »

        CBMatt

        • Mod & Malware Specialist


        • Prodigy

        • Sad and lonely...and loving every minute of it.
        • Thanked: 167
          • Yes
        • Experience: Experienced
        • OS: Windows 7
        Re: gobang
        « Reply #10 on: August 19, 2008, 10:40:02 PM »
        Anyone else find this a bit odd?
        Quote
        An undefined problem has an infinite number of solutions.
        —Robert A. Humphrey

        Carbon Dudeoxide

        • Global Moderator

        • Mastermind
        • Thanked: 169
          • Yes
          • Yes
          • Yes
        • Certifications: List
        • Experience: Guru
        • OS: Mac OS
        Re: gobang
        « Reply #11 on: August 19, 2008, 10:50:33 PM »
        How so?

        CBMatt

        • Mod & Malware Specialist


        • Prodigy

        • Sad and lonely...and loving every minute of it.
        • Thanked: 167
          • Yes
        • Experience: Experienced
        • OS: Windows 7
        Re: gobang
        « Reply #12 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.
        Quote
        An undefined problem has an infinite number of solutions.
        —Robert A. Humphrey

        qinghao



          Intermediate
        • Don't think your self special
          Re: gobang
          « Reply #13 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.