Page 1 of 1

Chess AI

Posted: Thu Nov 03, 2016 3:27 pm
by Vip96
Hi all, Im an undergraduate mechatronics engineering student with a passion for chess and almost no knowledge regarding coding a chess engine.
I have planned to make a robot which plays chess agiainst a human opponent. For this I require the code which holds the status of the board and gives the best possible move as the output. I have serached far and wide on the internet but I was presented with code that I couldnt make neither heads nor tails of. Could someone help me out here please? :D
PS: im looking for c++

Re: Chess AI

Posted: Fri Nov 04, 2016 8:30 am
by H.G.Muller
This is what all chess engines do. You can send them the board position, (or, more accurately, the preceding game history, so they will be able to detect repetitions), and they reply with the best move. So why would you need the code? You can just run an engine of choice as a separate process; there is need tomeddle with the code, or even have access to it, and you can use any binary for the platform you are running on. There are more than a thousand of such engines.

Which engine you should choose also depends on your goals. Do you want something that crushes any opponent in about 20 moves, or do you want something they can beat? There are several highly commented source codes for engines, including some of my own. The latter simple are all in plain C,though; I don't know C++.

Re: Chess AI

Posted: Sun Nov 06, 2016 5:37 pm
by Vip96
I see. I guess a regular engine would be enough. What do you recomend? Where can I download said engines/source code?

Re: Chess AI

Posted: Sun Nov 06, 2016 5:39 pm
by Vip96
I see. I guess some playable engine would do the deed for me. What do you suggest? Where can I download said engine/source code?