Scr4mble - 4K's first word game!

I’ve been working on this for the past 6 hours or so, it’s about as complete as it’s gonna get…

So here it is, Scr4mble:





The idea is simple… the game will show you a scrambled word. Your goal is to unscramble it. You’re awarded 1-point-per-letter of the word. You have 2 minutes to achieve a high score.

Depending on which version of Java you use, there are 750-1000 unique words


Welcome screen:

  • Press -ENTER- to start the game
  • Press -ESCAPE- to quit the application


  • Type the correct spelling of the scrambled word
  • Press -SPACE- to rescramble the word
  • Press -ENTER- to cheat (and lose 1-point-per-letter)
  • Press -ESCAPE- to return to the welcome screen

The game will run on 1.4.2+
The unsigned, non-standalone version weighs in at 3.56k. 3.88k with manifest, and 4.97 when signed

I “accidentally” created this game while experimenting with word scraping. For those who would like to create their own 4K word game, you can find my word scraping code here

Thanks for reading

– Matt

edit: added webstart

Very nice! It feels complete and polished, and the idea of word scraping via reflection is pretty darn clever.
It feels like the actual words are either very obscure or too simple, but I guess it’s kind of hard to work around that by just scraping what’s available from within java. =)

Cheers. Though I should mention I read about this idea a few years ago (I think Abuse was talking about it).

Yes definitely. That’s actually what prompted me to add the rescramble feature. But, unfortunately, some words (coalesce, postscript) are just too obscure when scrambled :slight_smile:

I like it, very polished!

I’ve still not done anything with the 2nd revision of my word scraper code.
The 1st revision used reflection like yours, but after losing the code, I rewrote it.
This time it reads the binary class files directly from rt.jar, extracts all utf8 Strings from the constants pool & then does some filtering.

I found this gets a much bigger dictionary (~20000 unique words), alot coming from comments contained in the classes.
It also gives slightly smaller code due to fewer references to api methods.

Though, i’m using regex for performing all of the word filtering - and it’s incredibly slow atm.
The culprit is mostly this monstrosity:

s.replaceAll("([a-z])([A-Z])","$1 $2" ).split("\\[L|(.)\\1{2,}|[\\W\\d_]+")

It takes about 2 minutes to fully parse the contents of rt.jar! :smiley:

Though due to word duplication there are obviously diminishing returns the further you get into the process… the first few 1000 words only take a second or two, so it isn’t quite so fundamentally flawed :smiley:


I havn’t looked at that regex expression since I wrote it back in sept. and I can honestly say without a regex manual, I have no idea what that split(…) is doing - isn’t regex brilliant! ;D


Maybe create difficulty levels for more difficult words?

This game reminds me of Text Twist, though not as fun. How is the word list stored? Why does retrieving it require reflection? The cheat option does not make that much sense to me. Maybe you should make this more like Lingo where there are effectively hints pointing you in the right direction.

It isn’t stored. He uses reflection to get class names which can then be split to generate words. Having a full list of words is impossible in 4k - I have a list of all 3 to 6 letter words in English and it zips to over 18kB.

But 4mb is way past the size limit. :stuck_out_tongue:

Wow, I almost forgot I posted this game

Don’t take it too seriously, reviewers :slight_smile:

As the source code states, it was just an experiment, I wouldn’t try too hard to find value in the game :stuck_out_tongue: