Answered step by step
Verified Expert Solution
Question
1 Approved Answer
( 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started