I'm trying to make a hash table for a connect four program that stores different board positions. The problem I am having though is finding a suitable key reference so that each key doesn't have too many to sort through.
My first attempt just had 48 keys, and a board was stored in the proper key depending on how many spots on the board were taken up (its a 6x8 board). The problem though was that some keys ended up managing over 4000 boards and I've only just begun.
Anyone have an idea for a key function that can span it out to say at most 30-50 boards per key (even better if less)? It would have to be a property of the board object so that the same board will always produce the same key number.