Jump to content
IGNORED

2600 Words (Wordle clone)


Karl G

Recommended Posts

(Updated 3/08/2022)

 

After seeing @mksmith's cool port of Wordle for the 7800, I thought I'd try my hand at making my own version.

 

This version is fairly complete and playable.

 

 

Instructions

 

You are attempting to guess a 5-letter word, and get six tries to do so. Guessed words have to be valid dictionary words. For each attempted guess, the game will color the letters of your word according to what you did or didn't get correct:

 

  • A letter that is in the word to be guessed and is in the right position will be colored green.
  • A letter that is in the word, but in a different position will be colored orange.
  • A letter that is not in the word at all will be colored gray.

 

Game Modes:

 

  • Seq. Play (SaveKey only): Play through the 2600 play dictionary words in order, and record stats for each game
  • Rand. Play: Play a random word from the play dictionary. Stats are not recorded in this mode.

 

 

Switches:

 

Left Switch = A: NO Sound Effects

Right Switch = A: Hard Mode (must use previously found letters in guesses)

Color/BW = BW: Color-blind friendly palette (enable/disable at start of game)

 

TODO:

 

  • Alternate play dictionaries (e.g. Nerd Words)

 

Version 9 (3/08/2022)

 

2600words-9-NTSC.bin

2600words-9-PAL60.bin

 

 

 

Javatari link

 

2600words_7.thumb.png.adddbd7db8c54083b9a2127c5e79cd6d.png

 

 

2600words_1.thumb.png.cce3e9e83f66479bcd10afdee11c7bee.png

 

2600words_6.thumb.png.f05781953b7d7733071bb7e95433db52.png

  • Like 23
  • Thanks 1
Link to comment
Share on other sites

Just now, jgkspsx said:

Wordle has two dictionaries: allowed words and game candidates. They are both easily dumpable, though I would be worried about remembering future Wordles if I looked :)

I imagine the "allowed words" dictionary is MUCH larger.  Since space is a critical resource for 2600 games, it would seem logical to just use a single dictionary.  I have not looked at the Wordle dictionaries myself, either.

 

 ..Al

  • Like 1
Link to comment
Share on other sites

27 minutes ago, Albert said:

Very cool!  How are you storing the words?

Right now, it's just an uncompressed block of bytes, 1 per letter. For the play dictionary, since time isn't critical when picking the word to be guessed, I'll likely compress the bits (only 5 bits needed for each letter) to save space.

 

For the bigger word validation dictionary, I'll likely have address lookup tables for every combination of the first two letters of a word, which will allow me to store only the last 3 letters of each word to save space and speed up the lookup for word validation.

 

27 minutes ago, Albert said:

How many words do you think you can store?  Can't this be the same pool of five-letter words used for the game?

The reason I don't want to use a single dictionary is because this would either have a lot of too-obscure words as play words, or for a smaller dictionary, it would reject too many guesses as being illegal words.

 

If 64K isn't considered too big (no SuperChip RAM needed), then I think I have plenty of room to have a good, fun play dictionary, and a full dictionary for word validation.

 

It's also possible that I could make a smaller "diet" version that only has the play dictionary, and does not do word guess validation. This version could comfortable fit in 16K, I think.

  • Like 1
Link to comment
Share on other sites

1 minute ago, Karl G said:

The reason I don't want to use a single dictionary is because this would either have a lot of too-obscure words as play words, or for a smaller dictionary, it would reject too many guesses as being illegal words.

This makes sense.

1 minute ago, Karl G said:

If 64K isn't considered too big (no SuperChip RAM needed), then I think I have plenty of room to have a good, fun play dictionary, and a full dictionary for word validation.

I'd use as much space as you need to store the largest dictionaries possible when using five bits per letter.

 

 ..Al

  • Like 1
Link to comment
Share on other sites

Some numbers:

 

64K EF = 16 4K banks to work with

 

Game logic: 1 bank (4K)

Play dictionary: 2 banks (8K). At 5 bits per letter for storage, this would be about 2600 words for the play dictionary. How cool is that? 

Lookup dictionary: 13 banks (52K). Address lookup tables for the starting 2 letters of each word will take up 1,352 bytes, but these allow me to store only the last 3 letters of each word (uncompressed for faster word lookup via binary search or the like). (53248-1352)=17,298 words.

 

The official Scrabble dictionary has 12,972 words, so this allows me to store all of them with plenty of space to spare.

  • Like 1
Link to comment
Share on other sites

That's great, thanks for doing the math.  :)

3 minutes ago, Karl G said:

The official Scrabble dictionary has 12,972 words, so this allows me to store all of them with plenty of space to spare.

Is this the size of the dictionary stored by the official web-based Wordle app?  I assume the official Scrabble dictionary is far larger than this, or is this just all the five-letter words in the official Scrabble dictionary?

 

 ..Al

  • Like 1
Link to comment
Share on other sites

10 minutes ago, Albert said:

Is this the size of the dictionary stored by the official web-based Wordle app?  I assume the official Scrabble dictionary is far larger than this, or is this just all the five-letter words in the official Scrabble dictionary?

I haven't looked at the dictionary that the actual Wordle app uses, but @mksmith says the play dictionary is 2,315 words and the word validation dictionary is 10,657 words. I wasn't going to use dictionaries dumped from the app, but I downloaded the official Scrabble dictionary in text format and grepped out any words that weren't 5-letters, which yields 12,972 words.

 

For the play dictionary, I also have a dictionary of English words sorted by word frequency, which I also cleaned-up to only contain 5-letter words. I'm going to take the first X words from this list, and tweak the list to my liking to form the play dictionary for the game.

  • Like 4
Link to comment
Share on other sites

I don't know Wordle (why does the game need two dictionaries?), but I know compression. :)  

 

Therefore I would suggest using Huffman encoding for the letters. This will reduce the number of bits required per letter. And decoding is pretty simple. I can provide help here.

 

 

Link to comment
Share on other sites

3 minutes ago, Thomas Jentzsch said:

I don't know Wordle (why does the game need two dictionaries?), but I know compression. :) 

As Karl mentioned above, the Scrabble word dictionary contains obscure words that most people would not be familiar with, so you don't really want to use that dictionary for gameplay words.  If Wordle had some sort of difficulty selection, and if the library words were marked with a degree of difficulty, you could probably then use one dictionary instead of two.  But if you're trying to reproduce Wordle (which is the case here), you need to do what Karl has done here.  :)

 

 ..Al

Link to comment
Share on other sites

13 minutes ago, Thomas Jentzsch said:

I don't know Wordle (why does the game need two dictionaries?), but I know compression. :) 

You are guessing a 5-letter word on Wordle, and all of your guesses have to be valid 5-letter words. The game will tell you, in Mastermind/Codebreaker style, if you have any correct letters in the correct place, or correct letters in the wrong place. The play dictionary should only contain words that most people have heard of, but still allow more obscure words as a guess.

 

13 minutes ago, Thomas Jentzsch said:

Therefore I would suggest using Huffman encoding for the letters. This will reduce the number of bits required per letter. And decoding is pretty simple. I can provide help here.

That's pretty cool, and would at least be handy for the play dictionary. For the word validation lookup dictionary, I picture doing a binary search to find the word in the dictionary, otherwise it seems like it would take much too long. Having address tables for every beginning 2-letter combination would get to the right ballpark to find the word, and a binary search could find if it exists or not fairly quickly.

 

So, my question would be: do you see a way to compress this data and still be able to do quick lookups of guessed words in a dictionary of ~13K words?

 

Edit: another consideration is limited RAM for any decompression routine. I don't use any extra cart RAM, and most of it gets used by the letter and color information for the play area and the keyboard.

Link to comment
Share on other sites

Just now, Thomas Jentzsch said:

I think adding a marker (or a difficulty value) to the Scrabble words would be most efficient. Then you would only need one dictionary, no?

Efficient once you've gone through and assigned a difficulty value to each word. Who's going to do that for 10,000+ words?  And it seems from Karl's description above that he can easily fit in the same number of words present in both dictionaries from the original Wordle game.  So this is definitely something I wouldn't personally spend time on if I was writing this.  I'd only consider it if I wanted to greatly expand the number of playable words.

 

Writing a script to go through both dictionaries and mark the words common in both so you only need to store one dictionary, I could see doing that.  But only if necessary to save space because you want to increase the available words.  That's assuming there is 100% overlap between the game dictionary and the Scrabble dictionary, which may not be the case.

 

 ..Al

Link to comment
Share on other sites

4 minutes ago, Karl G said:

So, my question would be: do you see a way to compress this data and still be able to do quick lookups of guessed words in a dictionary of ~13K words?

How fast does the lookup have to be? I still have to do the math, but it should be pretty fast even without binary search. If that's too slow, you could start searching in the background while the player is still active, e.g. as soon as the first letter is set. 

Edited by Thomas Jentzsch
Link to comment
Share on other sites

4 minutes ago, Albert said:

Efficient once you've gone through and assigned a difficulty value to each word. Who's going to do that for 10,000+ words?  And it seems from Karl's description above that he can easily fit in the same number of words present in both dictionaries from the original Wordle game.  So this is definitely something I wouldn't personally spend time on if I was writing this.  I'd only consider it if I wanted to greatly expand the number of playable words.

That's up to Karl.

4 minutes ago, Albert said:

Writing a script to go through both dictionaries and mark the words common in both so you only need to store one dictionary, I could see doing that.  But only if necessary to save space because you want to increase the available words.  That's assuming there is 100% overlap between the game dictionary and the Scrabble dictionary, which may not be the case.

We could simply merge both dictionaries, no? 

 

 

 

Link to comment
Share on other sites

Just now, Thomas Jentzsch said:

We could simply merge both dictionaries, no?

Sure, and that seems to be a reasonable thing to do when space is at a premium, as is the case here.  Since a 2600 game cannot download new words from the internet (at least when using typical hardware), I'd want to cram in as many words as possible.

 

 ..Al

Link to comment
Share on other sites

5 minutes ago, Albert said:

Since a 2600 game cannot download new words from the internet (at least when using typical hardware), I'd want to cram in as many words as possible.

With a PlusROM backend you can cram in as many words and languages as you want. ;-)

 

 

Link to comment
Share on other sites

If I used a byte to assign a difficulty for each of the 12972 words, that would be 12972 bytes. That's a little over 3 banks, and I am only planning on using 2 banks for the play dictionary. I think I'll stick with separate dictionaries for now at least, though it's possible that I'll change my mind during the development process.

  • Like 1
Link to comment
Share on other sites

I just did a coarse math based on the 2,315 Wordle words. Unfortunately the gain from Huffman compression is not very impressive. Instead of 2315*5*3=57,875 bits, the compressed data would require ~50,100 bits. So that would only save ~13%. Maybe the result becomes a bit better with Scrabble words, but the difference shouldn't be significant.

Link to comment
Share on other sites

Just now, Al_Nafuur said:

Alternatively typical emulators would work too. ;-)

True, but I'm thinking of more traditional cartridges where you're not able to update them without taking...extreme measures (although Melody and Aria-based games can be reprogrammed).  Therefore, you want to maximize what you can squeeze into the cartridge.  And we do have boards that support more than 64K now.

 

 ..Al

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...