WordCraft

My wife has a great fondness for those word games where you select words off a kind of rotary display. So I thought I’d start throwing together some tools to make it easy to create such games in Codea.

Oh I love these types of games too. Keen to take a look at your code

@Mark - just testing the scope of this, put in the name of a Welsh village llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch and it fell down. In the tradition of Spielberg’s Jaws - You need a bigger disc!!

Jokes aside, made a good attempt (see image) this is very impressive and I can see my grandkids playing with this, they are in the early stages of reading and writing and this could be a great way to improve their dictionary. Please post.on your progress.

Ha! I never gave it a test like that. Just coming up with all the possible words hidden in there would probably keep the iPad humming for an hour.

@Mark - works if you change font size down to 24, but then you run into line width problems. Need to scale font and line thickness on string length.

Pondered about setting up table of words with random selection. What you really need is an online dictionary to compare words for valid spelling - could go on forever!!!

Excellent programming style by the way - makes my hodge-podge of code look childish.

Bri_G I actually have a dictionary of about 60K words that’s encoded in an image to make it easy to tote around, and a class that decodes it into a collection of words. I was looking at re-engineering this to include information about each word like grade level and word origins. But I may go ahead and add the current, simple version that’s actually Codea code I wrote years ago.

Here’s a version that includes a 178K word dictionary encoded in an image, along with a class to decode the image. You might notice that the dictionary actually gets inserted into two tables — one indexed by each word itself, one indexed by numbers. This allows for both instantly checking if a word is present, and randomly pulling a word from the list. There may be a way to accomplish both without a double structure, but if so, I haven’t found it.

The image attached here is the necessary dictionary image.

@Mark - you just jogged my memory, I remember the encoding text into images and compression. Quite a few users involved in that - didn’t @dave1707 have a huge dictionary sorted out?

When you are talking about grade level - is this for education?

I’d get it up and running first with the code you have at hand. Once you have proven the principle then add the refinements.

@Bri_G I had a 300,249 word dictionary file in a 1025x1025 pixel image.

This 178k word dictionary, which is the same one I used for ScramWords six years ago, is encoded in a 768x768 image. But the biggest problem isnt finding a bigger on. This is really already quite large. The official Scrabble dictionary is much smaller.

If I was making a game, I’d likely look for a smaller dictionary, hopefully one with some info about each word, and encode it with something like grade level as a proxy for difficulty. But I’m really not working on anything. Just pitching up some code for anyone who was interested.

@Mark thanks for sharing. I had a bash at making a word game a few years back. I’ll dig out the code