I just wrote an online version of Set, a game of pattern-finding (and ultimately, math). There are instructions included.

While the game is totally JavaScript (runs in Netscape 4.7, and IE 5.5), it started out as a command-line version, in Perl. And I used GD::Image for the (pre-)generation of the images.

It's a fun game; I was taught it by a co-worker named Jes (who might be making an appearance here sometime soon, and who's probably coming up to YAPC with me). She's been using Perl for a while, and I'm helping her along.

UPDATE: if you find a bug, please email it to me; include your full browser name and version, and OS.

japhy -- Perl and Regex Hacker

Replies are listed 'Best First'.
Re: Set, online
by japhy (Canon) on May 02, 2001 at 03:49 UTC
    Well, duh. After running my Perl program to find the maximum number of cards in which no set can be found, I came to the stunning conclusion: I should've known.

    There are 4 traits, and the maximum number of cards that can exist and not produce a set is 2**4, 16.

    Here's the proof. Here, the numbers 1, 2, and 4 are octal bits that represent one of the three possible values for each trait.

    Set-> ABCDEFGHIJKLMNOP count 1111111122222222 color 1111222211112222 shade 1122112211221122 shape 1212121212121212
    Read them in columns. Here we have 16 cards (A through P) and there's not a set among them. However, as soon as I introduce a card with any number of 4's anywhere in it, we have a set.

    japhy -- Perl and Regex Hacker