On Tue, Dec 23, 2008 at 3:43 PM, John Randall <[email protected]> wrote: > Any help would be appreciated.
It seems to me that you can go a long way towards speeding this thing up by pre-calculating certain kinds of information, and "hard coding" that into the program. For example, for each orientation of a piece, only certain board positions are valid placements of that piece. Since a bit mask of board positions can be represented in a single number, and since each piece has at most eight orientations, you could represent this information in an array of at most 80 integers. Some inspection of that data should yield a much more compact representation. And, hypothetically speaking, this data could be converted into pure code, if that were desirable. It might also be possible to obtain some good heuristics by inspecting the set of all solutions. This would be a more interesting problem if the program were required to deal with an arbitrary sized board and an arbitrary set of piece shapes. However, if you solve the more interesting problem you are carrying a big burden in generality. -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
