We are going to try something different for our December meeting. Instead of a speaker, we will host the first ever CIJUG Code Off. We would like to give an opportunity for our members to show us their stuff. This will be a chance for the community to show off its creativity and passion for JVM technologies. For this challenge, we will be implementing a Connect Four game. The requirements for the application are listed below. All entries are due by Thursday December 7th at 5 pm. Up to three entries will then be selected by the CIJUG board to come present their solution at the December 14th meeting. The winner will then be selected by the audience at the December 14th meeting. The winner will receive a $50 Amazon gift card.
Connect Four
Given a playfield
And two players
When the players load the playfield
Then the players see a playfield that is a grid with 6 rows and 7 columns
And the players see a prompt to play a new game
Given a prompt to play a new game
And two players
When the players select to play a new game
Then the players are prompted to enter player 1’s name
Given a prompt to enter player 1’s name
When a player enters a name
And the player presses enter
Then the players are prompted to enter player 2’s name
Given a prompt to enter player 2’s name
When a player enters a name
And the player presses enter
Then the players see a playfield that is a grid with 6 rows and 7 columns
And player 1 is assigned to the red color
And player 2 is assigned to the black color
And player 1 is in control of the playfield
Given player 1 is in control of the playfield
When player 1 selects a cell of the grid
Then that cell is filled with the red color
And player 2 is in control of the playfield
Given player 2 is in control of the playfield
When player 2 selects a cell of the grid
Then that cell is filled with the black color
And player 1 is in control of the playfield
Given player 1 is in control of the playfield
When there are 4 red colored cells horizontally adjacent to each other
Then player 2 is not in control of the playfield
And the players see a prompt that the game is over
And the players see in the prompt that player 1 has won
And the players see in the prompt an option to play another game
Given player 1 is in control of the playfield
When there are 4 red colored cells vertically adjacent to each other
Then player 2 is not in control of the playfield
And the players see a prompt that the game is over
And the players see in the prompt that player 1 has won
And the players see in the prompt an option to play another game
Given player 1 is in control of the playfield
When there are 4 red colored cells diagonally adjacent to each other
Then player 2 is not in control of the playfield
And the players see a prompt that the game is over
And the players see in the prompt that player 1 has won
And the players see in the prompt an option to play another game
Given player 2 is in control of the playfield
When there are 4 black colored cells horizontally adjacent to each other
Then player 1 is not in control of the playfield
And the players see a prompt that the game is over
And the players see in the prompt that player 2 has won
And the players see in the prompt an option to play another game
Given player 2 is in control of the playfield
When there are 4 black colored cells vertically adjacent to each other
Then player 1 is not in control of the playfield
And the players see a prompt that the game is over
And the players see in the prompt that player 2 has won
And the players see in the prompt an option to play another game
Given player 2 is in control of the playfield
When there are 4 black colored cells diagonally adjacent to each other
Then player 1 is not in control of the playfield
And the players see a prompt that the game is over
And the players see in the prompt that player 2 has won
And the players see in the prompt an option to play another game
Given the players see a prompt with an option to play another game
When the players select yes
Then the players see a playfield that is a grid with 6 rows and 7 columns
And player 1 is assigned to the red color
And player 2 is assigned to the black color
And player 1 is in control of the playfield
Given the players see a prompt with an option to play another game
When the players select no
Then the program exits