Place your order now for a similar assignment and have exceptional work written by our team of experts, At affordable rates
For This or a Similar Paper Click To Order Now
REQUIRED FILENAME: The Filename for this evaluation MUST BE
tswift2_PRG355X.223.A2.cpp
format, where:
‘tswift2’ is your lowercase my.seneca user/login id
‘PRG355X’ is your UPPERCASE course code and section (eg. PRG355A, PRG355B, etc)
‘semester’ is the current 3 digit semester (eg. 223 for 2022 semester 3)
‘evaluationAndNumber’ is the UPPERCASE evaluation type and number
(eg. A1 for Assignment 1, A2 for Assignment 2, etc), and
‘fileExtension’ is the correct file extension (eg. py for c++ files)
For example, the CORRECT file name for a my.seneca user id of tswift2 submitting
assignment #2 for PRG355B as a Python file for the fall 2022 semester would be:
tswift2_PRG355B.223.A2.cpp
NOTE:
If the filename used is not specified EXACTLY as stated above, this program
will not accept your solution.
SUBMISSIONS MUST NOT INCLUDE main( )
When submitting your code, you are NOT to include the main( ) function
and you may NOT add ANY additional C/C++ libraries using the #include
directive other than the ones already provided with the main( ) below.
You will only be submitting the code containing YOUR solutions.
SPECIFICATIONS:
For your second assignment this semester in PRG355, you are required
to write a standalone text-based C++ program that allows a single player
to play a CROSSWORD game.
Requirements:
Your program is required to do the following:
1. Navigate 2-dimensional array game boards.
2. Insert text strings within the 2D array (hidden from view).
3. Validate game coordinates within the 2D array.
4. Uncover individual characters at a specific location in the 2D array.
5. Keep track of the player’s score, last selection, and update the game board.
A sample game board (35×35) with titles, headings, and written
by a student named: Tom Swift is displayed below:
C++ Crossword Puzzle… By: Tom Swift
123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
1|……………………………..|
2|……………………………..|
3|……………………………..|
4|……………………………..|
5|……………………………..|
6|……………………………..|
7|……………………………..|
8|……………………………..|
9|……………………………..|
A|……………………………..|
B|……………………………..|
C|……………………………..|
D|……………………………..|
E|……………………………..|
F|……………………………..|
G|……………………………..|
H|……………………………..|
I|……………………………..|
J|……………………………..|
K|……………………………..|
L|……………………………..|
M|……………………………..|
N|……………………………..|
O|……………………………..|
P|……………………………..|
Q|……………………………..|
R|……………………………..|
S|……………………………..|
T|……………………………..|
U|……………………………..|
V|……………………………..|
W|……………………………..|
X|……………………………..|
Y|……………………………..|
Z|……………………………..|
Current Score:0000 Last Move: NA
Specifications:
You are to write the code for a C++ class exactly as declared below:
class Crossword {
private:
char board[35][35], mask[35][35];
int score;
char *playerName;
char coord[3];
public:
Crossword( );
Crossword(const char *name);
void loadWord(const char *coord, const char *word, char dir);
void updateGameBoard(const char *coord);
friend ostream& operator<<(ostream &os, Crossword &r);
~Crossword( );
};
Basic game-play overview:
The game board will always consist of a 2-dimensional char array with
dimensions of 35 rows x 35 columns such that the rows and columns are
to be labeled 1 to 9 and A to Z. The rows are labeled on the left and
the columns at the top.
The game board's left and right boundaries are to be drawn using the '|'
character and the board contents itself drawn using only the '.' character.
Your program will insert words into the game board (2D array) at
specific locations (initially hidden from view).
The words themselves will not be displayed (of course), but must be tracked
internally. The program will then uncover the contents of the board one
coordinate at a time.
Points (5 points for each letter uncovered) are awarded if a player selects a
coordinate that uncovers one of the word's characters.
When this happens, that specific character and ALL characters in the
same row or column that it is connected to are then uncovered (replacing
the '.' with the actual letter in the character).
If a coordinate supplied does NOT uncover a letter in a word, then the '.'
is replaced with '~' character.
After each coordinate that is selected, your program updates the
current score (0000) and last move (with a "FOUND 'X' at '[X,Y]'" or
"NO letter FOUND at '[X,Y]'" message) (see below for examples).
This assignment MUST code the following functions as specified and will
be called appropriately from the main( ) function that will be supplied.
Processing:
You MUST code the following C++ functions as specified.
Crossword( )
+ This function inserts the "." character into each element of both 35×35 2D arrays,
sets score to 0, coord to "", and allocates enough memory to store a name of: "Tom Swift".
Crossword(const char *name)
+ This function inserts the "." character into each element of both 35×35 2D arrays,
sets score to 0, coord to "", and allocates enough memory to store the string
accepted as 'name'.
void loadWord(const char *coord, const char *word, char dir)
+ This function inserts the supplied string 'word' into the 2D array
'board' starting at cordinate 'coord' horizontally if 'dir' is 'H' or vertically
if dir is 'V'.
You may assume that 'coord' will ALWAYS be a 2 character string containing a
valid coordinate (numbers and uppercase characters only), that the supplied string
'word' will only contain printable characters and will fit within the 'board' 2D array
given the starting coordinate 'coord', and that 'dir' will always be either an "H" or a "V".
This function inserts the 'word' string (character by character) into the 2D array 'board'
(overwriting any characters already present) starting at the coordinate 'coord' from
left to right if 'dir' is "H" and from top to bottom if 'dir' is "V".
This function does NOT alter the 'mask' 2D array in any way.
void updateGameBoard(const char *coord)
+ This function attempts to uncover a word in the 2D array 'board' at location
'coord'.
+ This function determines if element at location 'coord' in the 2D array
'board' contains a valid word character (a character other than '.' or '~') and if
it does, writes that character to the exact same position in the 2D array 'mask'.
In addition, this function must also check if the character in any adjoining location
(i.e. left, right, up, or down from the coordinate supplied) contains a word character,
and if it does, also writes that character to 'mask'.
5 points are awarded for every character that is uncovered.
CAUTION: You must take care to not attempt to access an element in the 2D array that
is out of bounds (i.e. beyond the left/right or top/bottom indexes of the array).
Also, if the coordinate supplied uncovers a word character, the "Last Move:" message is
updated to add the text: "FOUND '?' at [X,Y]" (where '?' is the letter, 'X' is the row,
and 'Y' is the column) written at the bottom of the game board next to the
"Current Score: NNNN" message (see below for examples).
+ If the coordinate supplied does not uncover a word character, then the function simply
places the '~' character at that location in the 2D arrays 'board' and 'mask', and the
"Last Move:" message is updated to add the text: "NO letter FOUND at '[X,Y]'"
(where 'X' is the row, and 'Y' is the column) and written at the bottom of the game
board next to the "Current Score: NNNN" message such that 2 EXTRA newlines are output
after the last line of output (see below for examples).
UPDATED: THIS FUNCTION NEVER CLEARS THE SCREEN
+ This function simply prints the entire game board including
the game title, coordinate values, boundaries, and messages, using cout
but DOES NOT clear the screen!
The output is displayed by overloading the << operator with an
ostream object on the left and a Crossword object on the right
(see function prototype within the class) and is called immediately from
within this function!
~Crossword( )
+ This function simply removes any dynamically allocated memory.
Assuming a game board containing the words at the exact locations below:
……………………………..
……………..N……………..
………….HELLO WORLD………..
…………..X………………..
…………..A………………..
…………..M………………..
…………..I………………..
…………..N………………..
…………..E………………..
……………………………..
……………………………..
……………………………..
……………………………..
……………………………..
……………………………..
……………….N……………
……………….O……………
………………AREA………….
……………….T……………
……………….H……………
……………………………..
……………………………..
……………………………..
……………………………..
……………………………..
……………………………..
…C++ IS FUN!…………………
……………………………..
……………………………..
………………PUZZLE………..
………………..O…………..
………………..O…………..
…..7-SEAS……………………
……………………………..
……………………………..
and supplied coordinates of: "55", "2I" then the output would be:
C++ Crossword Puzzle… By: Tom Swift
123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
1|……………………………..|
2|……………………………..|
3|……………………………..|
4|……………………………..|
5|….~…………………………|
6|……………………………..|
7|……………………………..|
8|……………………………..|
9|……………………………..|
A|……………………………..|
B|……………………………..|
C|……………………………..|
D|……………………………..|
E|……………………………..|
F|……………………………..|
G|……………………………..|
H|……………………………..|
I|……………………………..|
J|……………………………..|
K|……………………………..|
L|……………………………..|
M|……………………………..|
N|……………………………..|
O|……………………………..|
P|……………………………..|
Q|……………………………..|
R|……………………………..|
S|……………………………..|
T|……………………………..|
U|……………………………..|
V|……………………………..|
W|……………………………..|
X|……………………………..|
Y|……………………………..|
Z|……………………………..|
Current Score:0000 Last Move: NO letter FOUND at [5,5]
C++ Crossword Puzzle… By: Tom Swift
123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
1|……………………………..|
2|……………..N……………..|
3|……………..O……………..|
4|……………………………..|
5|….~…………………………|
6|……………………………..|
7|……………………………..|
8|……………………………..|
9|……………………………..|
A|……………………………..|
B|……………………………..|
C|……………………………..|
D|……………………………..|
E|……………………………..|
F|……………………………..|
G|……………………………..|
H|……………………………..|
I|……………………………..|
J|……………………………..|
K|……………………………..|
L|……………………………..|
M|……………………………..|
N|……………………………..|
O|……………………………..|
P|……………………………..|
Q|……………………………..|
R|……………………………..|
S|……………………………..|
T|……………………………..|
U|……………………………..|
V|……………………………..|
W|……………………………..|
X|……………………………..|
Y|……………………………..|
Z|……………………………..|
Current Score:0010 Last Move: FOUND 'N' at [2,I]
MAIN PROGRAM:
/*
Your solution may ONLY use the C++ header files listed below
program: A2main.cpp
author: danny abesdris
date: november 15, 2022
purpose: C++ main( ) program for PRG355 Fall 2022 assignment #2
*/
TBA
# YOUR CODE BELOW…
Crossword( );
Crossword(const char *name);
void loadWord(const char *coord, const char *word, char dir);
void updateGameBoard(const char *coord);
friend ostream& operator<<(ostream &os, Crossword &r);
~Crossword( );
OUTPUT:
TBA
Why Work with Us
Top Quality and Well-Researched Papers
We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.
Professional and Experienced Academic Writers
We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.
Free Unlimited Revisions
If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.
Prompt Delivery and 100% Money-Back-Guarantee
All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.
Original & Confidential
We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.
24/7 Customer Support
Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.
Essays
No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.
Admissions
Admission Essays & Business Writing Help
An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.
Reviews
Editing Support
Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.
Reviews
Revision Support
If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.