Answered step by step
Verified Expert Solution
Link Copied!

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. I'm dying with the logic of this Stage 1.4- Add Bush
Also coincidentally, bushes have also been hurled onto Physics Lawn. Some in a single file,
creating small mazes. Stage 1.4 will extend off of Stage 1.3 with an additional foliage that can
be added onto the map.
A bushes are 1x length tiles. The start_row / start_col values are the starting position,
followed by orientation, which indicates the orientation of the bush. Either being h for
horizontal or v 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 1.3) and bushes (stage 1.4) 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 non-edge 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 non-edge 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 (5,1), spanning 5 tiles horizontally across the map and one added at (1,6), spanning 8 tiles vertically. Bushes are represented on the map as Assumptions / Restrictions / Clarifications
The start_row/start_column will always be integer values.
The orientation given will always be either v or h.
The orientation will always stretch towards the right/bottom 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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2004 Workshops Edbt 2004 Workshops Phd Datax Pim P2panddb And Clustweb Heraklion Crete Greece March 2004 Revised Selected Papers Lncs 3268

Authors: Wolfgang Lindner ,Marco Mesiti ,Can Turker ,Yannis Tzitzikas ,Athena Vakali

2005th Edition

3540233059, 978-3540233053

Students also viewed these Databases questions