Game Boy Wordle clone: How to compress 12972 five-letter words to 17871 bytes
21–30 of 170 posts
Re: Game Boy Wordle clone: How to compress 12972 five-letter words to 17871 bytes
#22Re: Game Boy Wordle clone: How to compress 12972 five-letter words to 17871 bytes
#23Bug? See screenshot. My 5th guess shouldn’t have gone down like that for a conventional Wordle clone. https://ibb.co/93CdVWv
Re: Game Boy Wordle clone: How to compress 12972 five-letter words to 17871 bytes
#24And far better than gzip compression. Nice work. My takeaway is that context matters - this is not General Purpose Compression, but compression made specifically for this case. Good Stuff.
To improve compression of a sorted list of words you can replace the (initial) letters repeated from the word above with spaces before compression and add them back as an extra step after decompression. For example, if the previous word was "apple", the next entry will be " y" ("apply", edit: HN removes extra spaces, so this should be four spaces + "y") ("apple" will probably already be entered as " le" (three spaces…
If you want to skim, check out the EXAMPLE section toward the bottom.
Re: Game Boy Wordle clone: How to compress 12972 five-letter words to 17871 bytes
#25And far better than gzip compression. Nice work. My takeaway is that context matters - this is not General Purpose Compression, but compression made specifically for this case. Good Stuff.
Re: Game Boy Wordle clone: How to compress 12972 five-letter words to 17871 bytes
#26 $ grep '^[a-z]\{5\}$' /usr/share/dict/words | python -c '
> from sys import stdin
> from os import write
> N = 26 ** 5
> data = bytearray((N+7)//8)
> for l in stdin:
> b = 0
> for c in l.strip():
> b *= 26
> b += ord(c)-ord("a")
> data[b//8] |= 1 write(1, data)
> ' | gzip | wc -c
12126
decompression code costs extra. Though I imagine someone has a small gunzip implementation somewhere.Re: Game Boy Wordle clone: How to compress 12972 five-letter words to 17871 bytes
#27Over on http://golf.horse/ there are leaderboards for finding the smallest Javascript programs that output various word lists, including the Wordle list. I've found it to be a fun and educational challenge. I would be excited to see more submissions!
Re: Game Boy Wordle clone: How to compress 12972 five-letter words to 17871 bytes
#28And far better than gzip compression. Nice work. My takeaway is that context matters - this is not General Purpose Compression, but compression made specifically for this case. Good Stuff.
Is task specific compression a thing in real life practical software engineering? As far as reducing data loads go I only came across the keyword "SQL optimization".
Re: Game Boy Wordle clone: How to compress 12972 five-letter words to 17871 bytes
#29And far better than gzip compression. Nice work. My takeaway is that context matters - this is not General Purpose Compression, but compression made specifically for this case. Good Stuff.
Is task specific compression a thing in real life practical software engineering? As far as reducing data loads go I only came across the keyword "SQL optimization".
Similarly, having to contain the decompression code in the measured result size and it being a relevant contribution is something that only applies in some use cases of compression.
Re: Game Boy Wordle clone: How to compress 12972 five-letter words to 17871 bytes
#30And far better than gzip compression. Nice work. My takeaway is that context matters - this is not General Purpose Compression, but compression made specifically for this case. Good Stuff.
Is task specific compression a thing in real life practical software engineering? As far as reducing data loads go I only came across the keyword "SQL optimization".
That's why people still write for the Z80: it's a fun toy.