Question: ( 1 6 % ) In a board game, there is an 8 8 board which contains jewels in the squares. The jewels are represented
In a board game, there is an board which contains jewels in the squares. The
jewels are represented by uppercase letters AZ The game would need to count the number
of horizontal and vertical sequences of three or more of the same jewel, eg AAA, BBB
etc. An example board is shown below which contains four horizontal sequences and three
vertical sequences. These sequences are highlighted in red rectangles.
Write a program file name: with a function void countchar board
int &h int &v; that finds the number of such horizontal and vertical sequences in
the twodimensional array parameter board. At the end of the function, the reference pa
rameters and should store the number of horizontal and vertical sequences respectively.
Eg suppose board contains the contents as shown above, then calling count board
shall write and to and respectively.
Note:
You can assume that parameter board is always of size
You can assume that parameter board always contains only uppercase letters AZ
What you write in the main function is unimportant. It may contain code to testcall
the required function. We shall grade only the required function.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
