Question: write code in c + + void Board::boardConfig ( ) { / / ( 8 pts ) / / Instructions for writing boardConfig: / *
write code in c
void Board::boardConfig
pts
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 would not, whereas row three could and row 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 walls.
For each wall, I picked randomly for vertical or horizontal just rand to get either
for vertical, for horizontal.
I set the easy version to have at most squares in a row or column as a wall, the
medium to have at most squares as walls in a row or column, and the hard version to
have at most 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 I then randomly chose squares in
row to be a wall if it was the easy version, if it was the medium, and 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
