andy75180 Posted March 25, 2006 Share Posted March 25, 2006 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 Link to comment Share on other sites More sharing options...
redbullmarky Posted March 25, 2006 Share Posted March 25, 2006 [!--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]AndyYou'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] Quote Link to comment Share on other sites More sharing options...
andy75180 Posted March 25, 2006 Author Share Posted March 25, 2006 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. Quote Link to comment Share on other sites More sharing options...
brokenhope Posted March 25, 2006 Share Posted March 25, 2006 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.