Question: void boardConfig ( ) ; / * this method and the moveDog method are probably the longest methods. * This method first puts dummy values

void boardConfig();
/* this method and the moveDog method are probably the longest methods.
* This method first puts dummy values in every square (I used '+'- I just didn't want
* every square to have gibberish, so I chose a character I wasn't using for any other
* purpose and initialized every square to have that value).
* I then added my random horizontal and vertical walls.
*
* Here's how I did it the walls:
*
* I only placed walls in the odd numbered rows and columns (in other words, row one might
* have a row, but then row 2 would not, whereas row three could and row 4 could not.
* Same with columns (although you can have flexibility.
*
* I picked an odd row or column that did not already have a wall in it at all.
*
* I generated a total of 10 walls.
* For each wall, I picked randomly for vertical or horizontal (just rand()%2 to get either
*0 for vertical, 1 for horizontal.
*
* I set the easy version to have at most 9 squares in a row or column as a wall, the
* medium to have at most 13 squares as walls in a row or column, and the hard version to
* have at most 16 squares per row or column.(but you can play with this because sometimes
* the hard version was seriously hard!!!
*
* Let's say I randomly decided to place a wall in row 3. I then randomly chose 9 squares in
* row 3 to be a wall (if it was the easy version, 13 if it was the medium, and 16 if it was
* the hard)
*
* So that's the walls. Then I added the 'D' to the beginning square nad an 'E' to the end square.
//Instructions for writing boardConfig:
/* this method and the moveDog method are probably the longest methods.
* This method first puts dummy values in every square (I used '+'- I just didn't want
* every square to have gibberish, so I chose a character I wasn't using for any other
* purpose and initialized every square to have that value).
* I then added my random horizontal and vertical walls.
*
* Here's how I did it the walls:
*
* I only placed walls in the odd numbered rows and columns (in other words, row one might
* have a row, but then row 2 would not, whereas row three could and row 4 could not.
* Same with columns (although you can have flexibility.
*
* I picked an odd row or column that did not already have a wall in it at all.
*
* I generated a total of 10 walls.
* For each wall, I picked randomly for vertical or horizontal (just rand()%2 to get either
*0 for vertical, 1 for horizontal.
*
* I set the easy version to have at most 9 squares in a row or column as a wall, the
* medium to have at most 13 squares as walls in a row or column, and the hard version to
* have at most 16 squares per row or column.(but you can play with this because sometimes
* the hard version was seriously hard!!!
*
* Let's say I randomly decided to place a wall in row 3. I then randomly chose 9 squares in
* row 3 to be a wall (if it was the easy version, 13 if it was the medium, and 16 if it was
* the hard)
*
* So that's the walls. Then I added the 'D' to the beginning square nad an 'E' to the end square.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!