Well, someone had to do it.



I don't really have a whole lot to say about it. The source code (including all ten comments) and releases are on GitHub if you're interested.

In the future I may work on reducing the size of the word list, but for now I just wanted to get this released before the game's popularity rapidly sublimates.
commandblockguy wrote:
Well, someone had to do it.


Yeah, I'm not surprised at all. Laughing

Anyways, this looks great! The graphics and animations look fantastic.
Nice! I think it looks pretty good too.
Nice graphics! What did you use to generate the word list?
If you mean the answer list, it's taken directly out of the actual game, so the puzzle on any given day is the same as on the computer. For the list of allowed words, I also took that from the real game, just formatted it as a text file with no newlines or anything, and ran convbin over it.

We were discussing possible ways of optimizing the file size in IRC the other day - an easy way of doing it would be to interpret each word as a base 26 string, and converting it to a 24-bit integer. For the allowed words, since it's an unsorted set, you could also just store the difference between the previous word, which most of the time will take much fewer than 24 bits.
I can't believe I haven't been using "TRAIN" as my starting word.

Great work on this, down to the animations, the statistics, and the post-game congratulatory phrases used. I'm very tempted to switch my daily Wordling to my calculator for the cool factor.
Awesome job on this! I've solved today's, and it's also nice for the word list to match up with the online one (so I can compare with my family and friends). Sadly "CALCS" is not a valid word... Razz

Keep up the awesome work! Very Happy
This looks very good, nice work! I particularly like the flipping animation used to reveal whether the word was correct or not, that's very cool. The statistics are pretty neat as well.

Any plans for further updates, or is this it? It does look basically complete to my eye, so probably not.
The main thing at the moment is probably compressing the word list somehow.
I'd also like to add support for localization or custom word lists.
The base-26 trick looks plausible, but since the built-in compression algorithm is already pretty good, it might not actually help. Something that probably will help, however, is not storing the word list as an array of null-terminated strings; the null terminator is already implied every five bytes, so it's not adding any new information. Just merge them all into one giant string and extract five characters on-demand.
I'm already doing that for the accepted word list, and thought I was for the solutions list, but apparently I changed that while I was testing the toast system and forgot to change it back. Whoops.
Welp, I appear to have accidentally created a compression contest, so I guess I might as well formalize the rules:

* The list of words is here. This is the same list of words used in WORDS.8xv.
* Size will be counted as the total size of the compressed word list plus the decompressor. Give the size of the compressed data and the size of the decompressor separately.
* Solutions are allowed 500ms of setup time, but then must determine if a given word is in the list in under 50 ms.
* Decompressors must be implemented in (e)Z80 machine code. For those who aren't familiar with eZ80 assembly, even if you don't plan on writing a legal decompressor, feel free to share the size of your compressed word list (though it won't be officially counted).

EDIT: the original times I gave were kinda made up on the spot and based on people's submissions seem too short. I'm increasing the time requirements to 2 seconds of setup time and 200 ms lookup time.
Size: 13602 bytes
138 bytes for decompression code
64 bytes for Huffman tables
13400 bytes of compressed data stream
Time: Under 500 ms to decompress; as fast as the current code to query

I was not sure if the Huffman tables should count as part of the decompressor or data, so I listed them separately. They are themselves compressed & contain, for both children of each non-leaf tree node, either a single 1 bit if the child is a not a leaf, or a 0 bit followed by bits 4-0 of the leaf's value.

The compressed data stream contains 26 level-1 blocks.
Each level-1 block contains 26 level-2 blocks unconditionally, since every letter can start a word.
Each level-2 block contains 26 level-3 blocks unconditionally, because this was cheaper.
Each level-3 block contains one or more Huffman-encoded differences, each of which is followed by a level-4 block unless the running total (which starts at 0x40) exceeds 0x5A.
Each level-4 block contains one or more Huffman-encoded differences, each of which is followed by a level-5 block unless the running total (which starts at 0x40) exceeds 0x5A.
Each level-5 block contains one or more Huffman-encoded letters, each of which is followed by a continuation bit (1 for non-final letters & 0 for the final letter).

Executing the decompressor 20 times takes between 6 & 7 seconds, so the time to decompress is somewhere between 0.3 & 0.35 seconds & thus in particular less than 500 ms. Checking if a word is in the decompressed list can be done as in the current program, because the output is the list of words (with no null terminators).

Concatenate the following code block with the subsequent paste to get the full test program. It was written in eZ80 machine language.

Code:
# Entry point for decompressor (D1A881)
# The DE load needs 147 bytes at a 256-byte-aligned address
F3 0E01 110032D0 210BA9D1 D9 01819300
CDF1A8D1 79 380A 3E08
CDF1A8D1 17 30F9 0D
0C D9 12 13 D9 10E8
# This HL load sets the output location
219332D0 0641
0E41
1640
AF CDFDA8D1 82 FE5B 3029 57 1E40
3E15 CDFDA8D1 83 FE5B 30E8 5F
3E2F CDFDA8D1 F640
70 23 71 23 72 23 73 23 77 23
CDF1A8D1 38E8 18DA
3E5B 0C B9 20C5 04 B8 20BF C9

# Fetch a bit from the compressed stream (D1A8F1)
D9 0D 2004 46 23 0E08 CB10 D9 C9
# Decode a Huffman-encoded letter (D1A8FD)
CDF1A8D1 8F D9 5F 1A D9 CB7F 20F3 C9

# Huffman table data (D1A90B)
0785B61898A37231C92BCC9E94B34E42AA8CF82D6170C4178C3F9049661DCA34
FE8249A8AD1B35ABB1FD3C5D90627494904CC38FE59A8618C3D80AAAF6AB148F

Compressed data stream (D1A94B): https://pastebin.com/g7xYJPvT

EDIT: Improved data encoding (14536→13622)
EDIT: Improved Huffman table encoding & made slightly faster (13622→13602)
Size: 13954 bytes
Code: 205 bytes
Data: 13749 bytes
Buffers: 64860 bytes
Initialization Time: 1.23 seconds
Query Time: unimplemented
Size: 13261 bytes
Code: 219 bytes
Tables: 26 bytes
Data: 13016 bytes
Buffers: 64860 bytes
Initialization Time: 1.41 seconds
Query Time: unimplemented
Size: 12341 bytes
Code: 237 bytes
Tables: 104 bytes
Data: 12000 bytes
Buffers: 64860 bytes
Initialization Time: 497 milliseconds
Query Time: unimplemented
Size: 12325 bytes
Code: 221 bytes
Tables: 104 bytes
Data: 12000 bytes
Buffers: 64860 bytes
Initialization Time: 477 milliseconds
Query Time: unimplemented
Size: 12344 bytes
Code: 301 bytes
Tables: 104 bytes
Data: 11943 bytes
Buffers: 189 bytes
Initialization Time: 1.07 seconds amortized over 27 calls, none taking more than 139 milliseconds
Query Time: 139 milliseconds worst case plus remaining initialization time

Added a GUI! My first valid entry! \o/
Not actually an overly serious entry. Wanted to scratch an itch, so to speak.

Size: 18543
Code: 152
Data: 18385
Query time: 73.5ms worst case (entry not found)

Note: Not actually intended to be decompressed, but can be done with modification. Expect decompression to run at similar speeds.

The sauce: https://github.com/Iambian/wordsearch-test-CE
I don't know if it is due to The New York Times acquiring Wordle, but it seems that the official word list is deviating from the list you have here. Perhaps you could release an update with the new list and the winning compression implementation?
Yep - next update I plan to give two options for the word list, "Classic" and "Corporate Sellout" editions.
my calculator wont run it because of this:
"ERROR: LIBRARY VERSION
LIBRARY NAME: FILEIOC
DOWNLOAD HERE: https://tinycc/clibs"
so i went there and downloaded it but it still does the same error. i even scrounged around for the actual FILEIOC file and found it, and it still doesnt work with it. any ideas?
I probably compiled it with the latest toolchain version on accident, I'll fix it in a bit.
If so, I'm somewhat confused as to how nobody managed to notice this prior to this point.
that is strange. thanks though!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement