Create the interface to allow playing the Colors game. (This is based on the excellent Android game Coloroid written by Ben Lewis.) Play is simple, and begins with the color of the square in the upper-left hand corner, with the goal being to change all squares on the board to the same color. On each move the user chooses a color, and all adjacent squares with that color join the captured area. The program keeps track of how many moves are made, comparing it to "par" for that level. If the user matches or beats par, play continues to the next level up. Screenshots of playing the game will look like what is shown below, where the Canvas window with the colored blocks is shown on the left, and the user input is shown on the right (user input shown in bold).
Author: Dale Reed (based off idea by Ben Lewis)
Program #4: Colors
TA: Engelbert Humberdink, Tues 6
Welcome to Colors! Play is simple, and begins with the color of the square in the upper-left hand corner, with the goal being to change all squares on the board to the same color. On each move choose a color and all adjacent squares with that color will join the captured area. On each move enter x to exit or one of the following:
a for aqua
b for blue
g for green
k for black
r for red
y for yellow
1.(Par 8) Your move -> r
Program #4: Colors
TA: Engelbert Humberdink, Tues 6
Welcome to Colors! Play is simple, and begins with the color of the square in the upper-left hand corner, with the goal being to change all squares on the board to the same color. On each move choose a color and all adjacent squares with that color will join the captured area. On each move enter x to exit or one of the following:
a for aqua
b for blue
g for green
k for black
r for red
y for yellow
1.(Par 8) Your move -> r
2.(Par 8) Your move -> a
TA: Engelbert Humberdink, Tues 6
Welcome to Colors! Play is simple, and begins with the color of the square in the upper-left hand corner, with the goal being to change all squares on the board to the same color. On each move choose a color and all adjacent squares with that color will join the captured area. On each move enter x to exit or one of the following:
a for aqua
b for blue
g for green
k for black
r for red
y for yellow
1.(Par 8) Your move -> r
2.(Par 8) Your move -> a
3.(Par 8) Your move -> b
Welcome to Colors! Play is simple, and begins with the color of the square in the upper-left hand corner, with the goal being to change all squares on the board to the same color. On each move choose a color and all adjacent squares with that color will join the captured area. On each move enter x to exit or one of the following:
a for aqua
b for blue
g for green
k for black
r for red
y for yellow
1.(Par 8) Your move -> r
2.(Par 8) Your move -> a
3.(Par 8) Your move -> b
4.(Par 8) Your move -> k
Welcome to Colors! Play is simple, and begins with the color of the square in the upper-left hand corner, with the goal being to change all squares on the board to the same color. On each move choose a color and all adjacent squares with that color will join the captured area. On each move enter x to exit or one of the following:
a for aqua
b for blue
g for green
k for black
r for red
y for yellow
1.(Par 8) Your move -> r
2.(Par 8) Your move -> a
3.(Par 8) Your move -> b
4.(Par 8) Your move -> k
5.(Par 8) Your move -> g
square in the upper-left hand corner, with the goal being to change all squares on the board to the same color. On each move choose a color and all adjacent squares with that color will join the captured area. On each move enter x to exit or one of the following:
a for aqua
b for blue
g for green
k for black
r for red
y for yellow
1.(Par 8) Your move -> r
2.(Par 8) Your move -> a
3.(Par 8) Your move -> b
4.(Par 8) Your move -> k
5.(Par 8) Your move -> g
6.(Par 8) Your move -> a
all squares on the board to the same color. On each move choose a color and all adjacent squares with that color will join the captured area. On each move enter x to exit or one of the following:
a for aqua
b for blue
g for green
k for black
r for red
y for yellow
1.(Par 8) Your move -> r
2.(Par 8) Your move -> a
3.(Par 8) Your move -> b
4.(Par 8) Your move -> k
5.(Par 8) Your move -> g
6.(Par 8) Your move -> a
7.(Par 8) Your move -> b
color and all adjacent squares with that color will join the captured area. On each move enter x to exit or one of the following:
a for aqua
b for blue
g for green
k for black
r for red
y for yellow
1.(Par 8) Your move -> r
2.(Par 8) Your move -> a
3.(Par 8) Your move -> b
4.(Par 8) Your move -> k
5.(Par 8) Your move -> g
6.(Par 8) Your move -> a
7.(Par 8) Your move -> b
8.(Par 8) Your move -> y
area. On each move enter x to exit or one of the following:
a for aqua
b for blue
g for green
k for black
r for red
y for yellow
1.(Par 8) Your move -> r
2.(Par 8) Your move -> a
3.(Par 8) Your move -> b
4.(Par 8) Your move -> k
5.(Par 8) Your move -> g
6.(Par 8) Your move -> a
7.(Par 8) Your move -> b
8.(Par 8) Your move -> y
*** Failure ***
9.(Par 8) Your move -> r
a for aqua
b for blue
g for green
k for black
r for red
y for yellow
1.(Par 8) Your move -> r
2.(Par 8) Your move -> a
3.(Par 8) Your move -> b
4.(Par 8) Your move -> k
5.(Par 8) Your move -> g
6.(Par 8) Your move -> a
7.(Par 8) Your move -> b
8.(Par 8) Your move -> y
*** Failure ***
9.(Par 8) Your move -> r
You did not make par. Restarting at level 4.
When a user succeeds in converting the board to the same color within par number of moves, then play continues at the next level, which in this case would be level 5, which might look like:
Similarly if the user succeeds at level 5, then a level 6 board would be given:
and so on. Play continues until the user succeeds at a 24 x 24 board (shown below), or exits the program.