Jump to content

Archived

This topic is now archived and is closed to further replies.

andy75180

Looking for PHP Chess Script

Recommended Posts

Hi, Does anyone know of any php scripts around that can play chess as an artifical intellegence player?

It wouldn't have to output any graphics, just return what position and piece it decided to move.

Any help with this one? Bit of a strange one I know.

Share this post


Link to post
Share on other sites
[!--quoteo(post=358245:date=Mar 25 2006, 04:31 PM:name=andy75180)--][div class=\'quotetop\']QUOTE(andy75180 @ Mar 25 2006, 04:31 PM) [snapback]358245[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Hi, Does anyone know of any php scripts around that can play chess as an artifical intellegence player?

It wouldn't have to output any graphics, just return what position and piece it decided to move.

Any help with this one? Bit of a strange one I know.
[/quote]

Andy

You'd have been better posting this in the 3rd party scripts forum. Either way, the first result that comes up typing 'php chess' into google is: [a href=\"http://www.redlionwebdesign.com/phpchess.htm\" target=\"_blank\"]http://www.redlionwebdesign.com/phpchess.htm[/a]

Share this post


Link to post
Share on other sites
Yes I have seen this website before on a search. But the script on that site is only for two players battling online. What I'm looking for is a script that acts like a computer player, playing chess against the user.

I've had a good look, but still no luck on any results.

Share this post


Link to post
Share on other sites
Well first off, since its going to be php, you will need a method of storing data, flatfile or a database, unless you put the data through constant submit forms, and resend the data of the move you made, and positions of everything. If it was javascript it would be a bit less complicated as far as moving goes... because plus if its through submit forms the data can very eaisly be altered... which if the game is just a fun game it doesnt matter, but if your planning on keeping records of who wins and such, youll need flatfile or a database... anyways...


artifical inteligence for this kinda thing is actually quite hard... your going to have to go 3 ways with this: determine the computers move based on the players move, basically design a way so the computer will always move a certain way if the play moves one way... like if the player moves say piece 2 forward to the left, the computer moves say piece 4 forward to the right... and it will always do that... you can add in some randomation as well... you can design it make it near impossible to win, I dont know how, but if you figure out how to counter every move the player does, and write it up, you can do that, or just completely randomize the computers moves... any way is going to be very difficult... AI is probably one of the most complicated things to do, I couldnt even write up some decent AI for tic tac toe.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.