Something cool happened
So, in programming my game I wanted it to be like a Scrabble game but with the letters are the signal flags the navy uses to talk to each other in the open water. There is one flag for every letter.
Anyway when I was talking to my wife about it she said that there is a CCO dictionary of Scrabble words. Wo I looked, and sure enough there was this list of over 172,000 words. That is a big list. How was I going to search it quickly as the player entered letters in real time?
So I went to Claude and asked what is the best method to search a list like that? It said a hash-table. In all my years as a coder I never used a hash-table I always used either a flat search, indexed search, even a binary search but never a hash table.
To make a long story longer I asked Claude to generate 'C' code that generates a hash-table. It did just that. Initially I didn't understand how it worked but I plugged it into my code and when using it the code and methodology became very clear. A hash-table is real time indexing method that uses the data to create an index into an array generating a 'hash' as the index. Do do the look up you generate the hash again and it should point to the array in the array where the data is. If the data is valid you will see it in your list, if not then you get something close. The only stickler is that the data has to be unique.
This was so interesting, and it worked so fast, I was just amazed.
The reason I am relating this story is because the main thrust of Ludum Dare and really all game jams is too finish a game, any game, and hopefully learn something new. Well, using Claude and writing this game I got a clear understanding of what a hash-table. Something for over fifty years I have avoided.
Just thought I would share.