Computer Principles and C++ Programming
At least two functions should have array parameter(s).
Game Description
Start condition:
There are 2 players (player Black and player White) and an empty square
game board (N*N).
Game stage:
The players take turn to place their pieces on empty cells of the board. (Player Black first place one black piece, then White and Black take turns, placing two pieces of their colors to empty positions each )
• End condition:
The player who first connects six or more consecutive pieces of his/her color in a line (horizontally ↔, vertically ↕, or diagonally ⤡⤢) wins the game
When the board is full and no player connects six or more, it is a draw
game
Board Representation
Square board of size N*N where N is a constant integer
In each position, “B” means black piece; “W” means white piece; and “.” indicates an empty
The rows and columns are named in numbers 0, 1, 2,… and uppercase letters A, B, C, …
Code representation:
N = 19
• board[0][0] => top-left
board[0][N-1] => top-right
board[N-1][0] => bottom-left
board[N-1][N-1] => bottom-right
When N is 19, the above refers to
A0, S0, A18, and S18 respectively.
We can simply modify the board
size by change a single variable N.
Handle B’s inputs
When handling the input:
If the input is valid, update the board and
print it.
Else ask for correct input again by printing “Invalid Enter again!” until a valid input is entered.
A user input is valid if: (a) it is a proper board location within bounds, and (b) the input position is empty. Note that column letters must be uppercase. Lowercase letters are considered invalid.
Recall that N is not always 19 => The right
most column / bottom row is not always S
e.g.,
H14 will be invalid in the rest of this
game since it’s been occupied
H300 will be invalid since it’s out of
the boundary
b4 will be invalid since it is in
lowercase
Ask white player to place the first
piece in this turn, handle W’s input,
check
(1) if the game hasn’t met the ending
condition, continue to step 4;
(2) else we end the game and
announce result.
Ask white player to place the second
piece in this turn, handle W’s input,
check
(1) if the game hasn’t met the ending
condition, continue to step 5;
(2) else we end the game and
announce result.
Program Flow
Ask black player to place the first
piece in this turn, handle B’s input,
check
(1) if the game hasn’t met the ending
condition, continue to step 6;
(2) else we end the game and
announce result.
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme