Color Match

Dennis Shasha

Omniheurist Course

Computer Science


 

Description

You are given a board dimension D and D*D pieces. Each piece has an interior design, but along each border there is a strip of color. Altogether there are k colors.

The game is played on a D by D board where players alternate moves of placing a piece on the board. When a piece is placed on the board and it is touching another piece, their color strips must match. Further, if the piece is on the outside of the board, then the outermost strip(s) must be red. A player wins if the last piece that his/her opponent last placed doesn't satisfy these rules. If a player completes the board while still satisfying the rules, then that player wins.

Architecture Team

Given D (dimension) and k (number of colors), you are to create D*D pieces whose borders come from the k colors. It should be possible to fill the board with any subset of those n pieces following the rules. Then you will accept moves from each player, and place the pieces in their appropriate spots. You will present a display of the board at all times and keep track of violation of the color match rules as well as time.

Variants include the requirement that every piece except the first one placed must touch an existing piece.