The Joy of Set

Back to Section 1 - The game of Set®
Forward to the next section - Some mathematics of Set®


2. The computer version - Advanced Set

My interest was in trying to answer this and several other questions that this game inspires.  Having a way of playing the game with more than 4 properties was the motivation to try to learn Java well enough to write the computer program that will play Set with larger decks of cards.

The computer program presented here has the possibility of playing the game with k different properties where k is between 1 and 7.  This version of the game not only varies the shape, color, number and shading of the objects on the cards, but also the size, left/right/center orientation, and background color.  The game played with a deck with 4 properties is challenging, while the game played with 5, 6 and 7 properties ranges from hard to nearly impossible.

Figure 2. Opening window of Advanced Set

The opening screen is shown in Figure 2, it contains the controls necessary to set the options for the game.  The background color is one of four different values.  Below that, there are a couple of buttons that set the base number of cards to be dealt, this can be between 3 and 36.  Below that there are seven different checkboxes, the first four will be checked already when the program starts as they correspond to the original game of set.  For a deck with 3
properties the game will recommend that 9 cards are dealt; with 4, 12 cards; with 5, 16 cards; with 6, 24 cards; and with 7, 32 cards.  These recommendations were chosen by experiment.  About 1 in every 10 times that the recommended cards are dealt there will not be a set.

The first button below the checkboxes starts or stops the theme music.  This music may not start to play immediately if it takes a while to load it over the internet.  It was borrowed from a recording of `The Flying Lizards.' It only plays during the appearance of the title screen and not during the game itself.  The
second button starts the game, while the last two buttons provide more information about the program.

Figure 3 shows the game board being played with a green background, 12 cards dealt, with 4 different properties (in this case shape, shading, left/right/center orientation and number) in the deck.  Clicking on a card will select (or unselect) it.  When three cards are selected the computer will decide if they are a set and remove them if they are.  There is a button that activates sounds so that a positive noise will be made if a set is found, a negative one if a the triple turns out not to be a set.

Figure 3. The playing field of Advanced Set

There is a button that will give up to three hints.  The first hint will be whether a set exists in the cards that are showing (the message will be either 'Triple exists' or 'No triple exists').  The second hint will be the position of one card that is part of a set. The third and last hint will be the position of a second card that is in a triple.

If no set exists, the only way to continue is to deal three more cards.  If a set does exist then the button that deals three cards will be disabled.

The quit button will immediately end the game and return to the main screen.


Back to the Java version of Advanced Set
Back to Section 1 - The game of Set®
Forward to the next section - Some mathematics of Set®
To the home page of the author, Mike Zabrocki

email: zabrocki(at)mathstat(dot)yorku(point)ca