A bitboard would work, but in my opinion, the added effort and complexity just to get it working properly isn't worth any possible gains in computing efficiency later on.
In the overall scale of things, any efficiencies from bitwise masking (&
or |
) over fetching an element of an array (or even a List
or Map
) would be largely overshadowed by whatever AI or search algorithm you intend to use.
That is, an algorithm of exponential or polynomial complexity will still take O(e^n)
or O(n^d)
and what few CPU cycles you save with binary arithmetic over pointer dereferencing will be insignificant.
Just go with the easiest data structure you can use at this point (probably an array, or whatever Collection
) and focus on getting your algorithms to work.
Later, if you have time, you can profile your program and if you find that array lookups are taking up, say, 20% of your run-time then maybe, just maybe, consider refactoring everything to bitwise ops.
Personally, I'd look at possible ways to conduct the searches of the solution space in parallel, to maximize multiple CPU cores, or better yet, in a way that can be distributed across multiple compute nodes. Yes, that'd probably qualify you for at least Master's degree if you discover something really clever. :)