Quadriletteral

http://www.java4k.com/index.php?action=games&method=view&gid=276
Translations available from http://www.toothycat.net/~pjt33/java4k/quadriletteral/quad.html

Word games are fairly rare in the J4K competition because of the problem of fitting in a dictionary. Until now people have either hard-coded a small set of levels or used reflection to scrape a dictionary. Quadriletteral takes a new approach: the game is designed to require only words of 4 letters; it features a dictionary of over 2000 words and has over 1 million possible distinct puzzles.

You’re given 16 letters with which to fill a 4x4 grid so that you make four words across and four words down. You can get up to 8 hints, each of which reveals one letter in the* solution. However, if you take all 8 hints you’ll struggle to get a good score.

The UI sucks, I admit, because fitting in as large a dictionary as possible was a higher priority. I hope to have time to go back and hand-optimise in order to squeeze in a few more words. However, before doing that I’d like feedback on other aspects, in particular the colour scheme (does it have enough contrast for red-green and for yellow-blue colour-blind people?) and the scoring.

  • TODO Check that no double solutions are possible.

Ouch, it’s hard for me 'cause my mother language is not English…

I was tempted to do a Spanish version too, but ñ would complicate the loops. I suppose I could make a dictionary which excludes it…

If anyone wants to supply me with a dictionary of 4-letter words containing only characters a-z in their native language (optionally dropping diacritics - I think this is normal for word games) then I can put together a version which they can play. It probably won’t be 4k but it will let you get a taste for the gameplay.

I found it hard even though I’m English and I like word games. I played a few times and I think 4 hints was the best I did.

pjt33, care to share how you’re compressing the dictionary? I only managed to get 1000 or so words in my entry last year. Although I did go up to 6 letters.

It relies to some extent on the fact that all the words are the same length. Then it’s a case of manipulating it so that kzip can do a good job.

Step 1. Split into digraphs and group by head:
e.g. ab->[ed,et,le,ly,ut], ac->[ed,es,he,hy,id,me,ne,re,ts], ad->[ds,ze], ae->[on,ry], af->[ar], …

Step 2. Sort by number of tails (so all digraphs like “af” which only have one completion come first, etc).

Step 3. Each head+tails can be encoded as a number giving the size of the set, the head, then the tails. E.g. 1afar1ajar…5abedetlelyut… However, by using difference encoding on the sizes you can get most of them to be 0 or 1. 1afar0ajar… As 0 and 1 are pretty frequent in the .pack file the difference-encoded lengths don’t need any further treatment.

Step 4. Count letter frequencies. Count bytecodes 0-25 in the .pack file produced with an empty string in place of the data. Assign letters accordingly (i.e. ‘s’ -> 21, which is the most common byte - not surprising, because it’s the opload for iload; ‘e’ -> 0; etc).

Step 5. Emit the alphabet* ordered so that I can do a charAt to invert the mapping set up in 4. Emit the string from 3 encoded as specified in 4.

  • Actually 1-26 where 1 corresponds to ‘a’ and 26 to ‘z’.

I’m in awe of your 4 hints!

I’m struggling to finish some of the puzzles even after 8 hints!
There are just too many ambiguous words due to interchangeable vowels.
Not to mention i’ve never heard of half of the words in this ;D

Not going to give up though =)

I give in, i’m rubbish :stuck_out_tongue:

Cunning! :o

This one is a bit too tough for me :frowning:
I think I managed to solve it (with no less than 8 hints), but I had to google for some really obscure words. I think giving a few “free” hints straight up would be welcomed.

I generally take 4 hints straight off and see where I can go from there, but I want to give people the option.

In terms of finding obscure words, I did consider adding a tick by rows and columns with a word in them (whether it’s the “right” word or not); the problem is that I’ve had to remove some words from the dictionary to get the size down, and people will complain if e.g. “BIRD” isn’t ticked.

I played about 5 times and only saw what I thought were everyday words.

It all changes colour if you’ve found the intended solution, so there shouldn’t be any doubt.

Lovely ::slight_smile:

S E A S
T Y P E
A R S E
B Y E S

Hands up who knows what an eyry is? (no googling!)

A type of bird?

Sounds like orrery.

EDIT: I was close. :slight_smile: Looks like that creative writing minor helped me out a bit.

How about oleo :persecutioncomplex:

A delicious cookie snack. :wink:

Not sure at all. Never heard anything like that before. Maybe some type of music or cadence?

Edit: Nope, totally off on that one.

Someone needs to do an EnglishLanguage.gc(); ::slight_smile:

Hi pjt33 ,

WOW that is amazing. I really like how you approached the
scrambling of the words. That is for me the coolest thing about
this competition: to think of ways how to overcome obstacles!

Unfortunately, even with 8 hints it is too hard for me.

How many possible grids can you make when you for instance
have only unique characters? This limits the placements of
the vowels which could make things a bit easier???
I don’t know if this will limit the possibilities too much and
therefore create a too easy game?

Or combine this game with mastermind where you ask how
many characters are on the right place in the grid:

STIL
LOTO
AUTO
PHIT

[CHECK] Result: There are 6 characters on the right place

20 years ago I typed in all the 3,4,5,6,7,8 and 9 character words
from a dictionary because I wanted to create a word-game myself
in Basic. Luckily we nowadays have on-line versions of those
dictionaries.

I have used Java (ofcourse) to get the 4-character words out of
the dictionary and put them in the attached jar file.

Looking forward to the dutch version of this interesting game!

Best regards from

M.E.

An eagle’s nest. Honestly, don’t you know anything about ornithology?

Oleo I admit I looked up and considered manually excluding as too en-us. In the end I decided to exclude swearwords (which I generally exclude for word games because I’m thinking of the parents of the children); currencies (bani, lira, etc); a few antiquated words like “mixt” and “doth”, words for which I couldn’t find any definition at all, words which I believe are proper nouns or abbreviations, and a very small number of non-trans-Atlantic words. (To be honest, I really wanted to be able to say that there are over 1 million distinct puzzles, and if I cut oleo I couldn’t make it. And anyway, word games are supposed to be educational).

One. The letters are ACGHIEMNOPRSTUWY. Good idea, but unfortunately not very practical.

[quote]Or combine this game with mastermind where you ask how many characters are on the right place in the grid:

STIL
LOTO
AUTO
PHIT

[CHECK] Result: There are 6 characters on the right place
[/quote]
Hmm. There’s a slight complication because of the symmetry around a diagonal - I could report the largest match but there would be potential to confuse. And I’d have to think about how to tie it into the scoring system. But that’s an intriguing idea and I may come back to it.

[quote]Looking forward to the dutch version of this interesting game!
[/quote]
http://www.toothycat.net/~pjt33/java4k/quadriletteral/quad.html is the new page to which I will add links to translated versions. I’m sticking to .jars because I don’t want to fiddle around with enabling pack200 support on the server, but FWIW the packed Dutch game is smaller than 4k even though the jar isn’t.

Thanks pjt33,

The Dutch4K version was much easier for me :slight_smile:

Ha ha ha One possible grid, that would be very,
very easy !

Interesting to see how you would be able to
get some other gameplay going … But I love
the game as it is at the moment, especially the
dutch version :slight_smile: :slight_smile:

Best regards from

M.E.