Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re: Re: "Rites of Passage" wheel reinventing

by hardburn (Abbot)
on Feb 26, 2004 at 22:12 UTC ( #332114=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: "Rites of Passage" wheel reinventing
in thread "Rites of Passage" wheel reinventing

Nah, you just need to have a board with one piece on it and generate all possible moves for that piece from that postion. Then put that data in the lookup table and do it again for the next piece or position. You'll still have to do a little runtime work like check that the piece isn't jumping over other pieces (except for knights) and isn't landing on a square already occupied by a freindly piece, plus few other special cases (like pawn attacks). For the most part, though, lookup tables get the hard part done.

----
: () { :|:& };:

Note: All code is untested, unless otherwise stated


Comment on Re: Re: Re: "Rites of Passage" wheel reinventing
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://332114]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-08-30 09:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls