Set puzzle: Difference between revisions

m
clean up header material
(promote to task)
m (clean up header material)
Line 1:
{{task}}
 
Set Puzzles are created with a deck of cards from the [http[wp://en.wikipedia.org/wiki/Set_%28game%29 Set Game(TMgame)|Set Game™]]. The object of the puzzle is to find sets of 3 cards in a rectangle of cards that have been dealt face up. There are 81 cards in a deck. Each card contains a unique variation of the following four features: ''color, symbol, number and shading''.
 
; there are three colors: '''red''', '''green''', or '''purple'''
 
; there are three symbols: '''oval''', '''squiggle''', or '''diamond'''
 
; there is a number of symbols on the card: '''one''', '''two''', or '''three'''
 
; there are three shadings: '''solid''', '''open''', or '''striped'''
 
Three cards form a <u>''set</u>'' if each feature is either the same on each card, or is different on each card. For instance: all 3 cards are red, all 3 cards have a different symbol, all 3 cards have a different number of symbols, all 3 cards are striped.
 
There are two degrees of difficulty: [http://www.setgame.com/set/rules_basic.htm ''basic''] and [http://www.setgame.com/set/rules_advanced.htm ''advanced'']. The basic mode deals 9 cards, that contain exactly 4 sets; the advanced mode deals 12 cards that contain exactly 6 sets. When creating sets you may use the same card more than once. The task is to write code that deals the cards (9 or 12, depending on selected mode) from a shuffled deck in which the total number of sets that could be found is 4 (or 6, respectively); and print the contents of the cards and the sets. For instance:
 
'''DEALT 9 CARDS:'''
 
:green, one, oval, striped
DEALT 9 CARDS:
 
:green, one, ovaldiamond, stripedopen
 
:green, one, diamond, openstriped
 
:green, one, diamond, stripedsolid
 
green:purple, one, diamond, solidopen
 
:purple, onetwo, diamondsquiggle, open
 
:purple, twothree, squiggleoval, open
 
purple:red, three, oval, open
 
:red, three, ovaldiamond, opensolid
 
'''CONTAINING 4 SETS:'''
red, three, diamond, solid
 
:green, one, diamondoval, openstriped
 
:purple, two, squiggle, open
 
:red, three, diamond, solid
CONTAINING 4 SETS:
 
green, one, oval, striped
 
purple:green, twoone, squigglediamond, open
 
red:green, threeone, diamond, solidstriped
 
:green, one, diamond, opensolid
 
green, one, diamond, open
 
:green, one, diamond, stripedopen
 
green:purple, onetwo, diamondsquiggle, solidopen
 
purple:red, three, oval, open
 
green, one, diamond, open
 
:purple, twoone, squigglediamond, open
 
red:purple, threetwo, ovalsquiggle, open
 
 
purple, one, diamond, open
 
purple, two, squiggle, open
 
purple, three, oval, open
 
:purple, onethree, diamondoval, open
 
=={{header|D}}==
Anonymous user