Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLease help. I ' m dying with the logic of this Stage 1 . 4 - Add Bush Also coincidentally, bushes have also been hurled
PLease help. Im dying with the logic of this Stage Add Bush
Also coincidentally, bushes have also been hurled onto Physics Lawn. Some in a single file,
creating small mazes. Stage will extend off of Stage with an additional foliage that can
be added onto the map.
A bushes are length tiles. The startrow startcol values are the starting position,
followed by orientation, which indicates the orientation of the bush. Either being for
horizontal or for vertical. Lastly
tells us how many tiles across from their initial
spawn position they stretch.
For bushes, you will need to change the tile type from EMPTY to BUSH A successful
addition will print
HINT Since both branches stage and bushes stage are types of foliage, consider
using a unified approach for handling both types of foliage. Additionally, consider splitting up
taking input into multiple
statements since different types of foliage have a
different number of inputs.
Error Handling
Similar to previous stages, bushes must be added within a predetermined boundary which
are all the nonedge tiles of the map. If the position of the foliage lies outside, then that
addition will be skipped not added and the program should print out Invalid foliage test comment and results Error Handling
Similar to previous stages, bushes must be added within a predetermined boundary which are all the nonedge tiles of the map. If the position of the foliage lies outside, then that addition will be skipped not added and the program should print out
Here is a diagram of a bush being added at spanning tiles horizontally across the map and one added at spanning tiles vertically. Bushes are represented on the map as Assumptions Restrictions Clarifications
The startrowstartcolumn will always be integer values.
The orientation given will always be either or
The orientation will always stretch towards the rightbottom of the map.
The length given will always be a positive integer.
The length will not cause the bush to exceed the boundary.
Bushes can intersect each other.
Branches and bushes will never share the same position.
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