Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2015-10-06 19:37 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (159 votes), past polls