My scrabble movegenerator works.
Any tips welcome. I’m a performance freak. It is already quite fast but who knows…
I did not upload an English dictionary text file, which is needed to run the program. And in the code there is a hard-coded path to that file as well.
The ultimate goal is to create a real search-engine starting from here.
There is a lot of clunky std debug print in the code. Don’t look at it
Hi, complete noob here; I git cloned you repo & am trying to play a game of scrabble from my terminal. It’s only a movegenerator with a Gordon algorithm so daaaah me. What did I really expect ?.. Just being curious about what motivates people to write code.
I looked at the code and what is it that I can do with that now that I git cloned it ? I typed zig build and gave me a error saying : expected enum literal …
Well I thought of reviving this post since it was the less viewed post under the Showcase categories. I am gonna go ahead & ask AI “what is Gordon Algorithm ?” so I at least learn something nice
Hello, not compiling is strange. I am currently completely rewriting it all. Faster smaller better…
Could you say which file / line the compilation stops? (if I have time I will have a look).
You need anyway a textfile with words in the main function, which is not included on github.
In very short: gaddag is a data structure where words are stored with “all possible inverted prefixes” followed by a pivot node and after that suffixes.
This makes it possible to generate moves very fast by first tracking backwards (Right to Left) and recursively go forwards if we reached the beginning of a word.
I bet that that error was related to the build.zig.zon change between zig version 0.13 and 0.14, you probably tried running the code with 0.14 while it was still written for 0.13 where the value for .name is a string, but zig version 0.14 expects an enum literal. So try running it with 0.13.
I see, that is it ! I am running 0.14 & my next project is to install zig version 0.13 & easily switch between the 2 versions by commenting out a line from .bashrc file I believe.
Is there not a way of avoiding projects written in earlier zig versions from being left behind in the dust ? Or is it just me that I should get used to it because that’s how programming in general works regardless of the language ?
I will investigate the changelogs from versions to versions & I have a lot to learn but good catch on this one @Sze