Jump to content

need help with chess engine

- - - - -

  • Please log in to reply
24 replies to this topic

#1
twinArmageddons

twinArmageddons

    Newbie

  • Members
  • PipPip
  • 24 posts
so im making this chess game right? but im having problems implementing a chess engine to be the "brain" of the CPU opponent

right now the player can only face another human opponent


ive tried many chess engines like cheoss and GTChess, but most off them are either entire chess games minus a visual interface or completely unintelligible becuz the coder didnt put any instructions

the move method uses an int as a parameter, wtf?


anyways, what im looking for is a code that takes my moves as parameters and returns other moves, chess AI

anyone know a good chess engine for that?

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Have you looked at GNU Chess — GNU Project — Free Software Foundation (FSF)
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
twinArmageddons

twinArmageddons

    Newbie

  • Members
  • PipPip
  • 24 posts

WingedPanther said:


ok...

so what do i exactly have to download?

i mean theres a lot of stuff in that folder, even in the chess folder, what should i download?

#4
Revolt

Revolt

    Programmer

  • Members
  • PipPipPip
  • 99 posts
You should download the tar.gz of the most recent version:

http://ftp.gnu.org/p...ss-6.0.0.tar.gz

#5
twinArmageddons

twinArmageddons

    Newbie

  • Members
  • PipPip
  • 24 posts

Revolt said:

You should download the tar.gz of the most recent version:

http://ftp.gnu.org/p...ss-6.0.0.tar.gz

*facepalm*

what makes you believe, i posted this on the java section looking for some c++ code?

#6
Revolt

Revolt

    Programmer

  • Members
  • PipPipPip
  • 99 posts
Firstly, I didn't bother checking the source code. I only answered your question of what file you should download.

Secondly, you can interface Java and C++ so you should be able to use that chess library as is by implementing a wrapper around it in Java: Java Tip 17: Integrating Java with C++ - JavaWorld

As for native Java engines I'm afraid I can't help you with that since I have no experience in that field.

#7
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
GnuChess is a command-line program. You should be able to have Java issue the command-line prompts to the compiled .exe and parse the response string.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#8
twinArmageddons

twinArmageddons

    Newbie

  • Members
  • PipPip
  • 24 posts

WingedPanther said:

GnuChess is a command-line program. You should be able to have Java issue the command-line prompts to the compiled .exe and parse the response string.

uhmm... how do i do that, how i send the command line to the exe file and how i receive it?

#9
lethalwire

lethalwire

    while(false){ ... }

  • Members
  • PipPipPipPipPipPipPip
  • 748 posts
  • Programming Language:Java, PHP
  • Learning:Java, PHP

twinArmageddons said:

uhmm... how do i do that, how i send the command line to the exe file and how i receive it?

Let me google that for you

#10
Sinipull

Sinipull

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 386 posts
Why don't you write your chess engine yourself? Seems like a simple task enough.

#11
twinArmageddons

twinArmageddons

    Newbie

  • Members
  • PipPip
  • 24 posts

Sinipull said:

Why don't you write your chess engine yourself? Seems like a simple task enough.

what? no!

ive already spent a month programming the chess game itself, i just need the AI opponent, plus i have no idea how to program a chess engine, because for starters, i suck at chess

#12
twinArmageddons

twinArmageddons

    Newbie

  • Members
  • PipPip
  • 24 posts

WingedPanther said:

GnuChess is a command-line program. You should be able to have Java issue the command-line prompts to the compiled .exe and parse the response string.

well now there are two problems, the first being, i dont know how to do that

the second, i cant find the .exe file on the gnuchess folder




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users