Question: If you had previous programming experience - it is advisable to start with the bonus problem and see whether you can complete it Students who
If you had previous programming experience it is advisable to start with the bonus problem and see whether you can complete it Students who didn't have prior programming experience should only attempt the bonus problem after completing the regular problems.
Clara is always on a lookout for new hobbies. Very recently she became a mushroom collector. Her task is to find a single mushroom in the world similar to the one shown in Figure and push it so that it is eventually located on top of the leaf as shown in Figure In order to push the mushroom it must be approached from behind and any movement forward while being behind the mushroom will result it being pushed forward.
Figure
This world of Clara has two chambers connected by a turnel. Clara and the mushroom are located in the left chamber. In the right chamber there is a leat. Clara must find the mushroom then push it into the chamber on the other side Once on the other side, the mushroom is to be pushed onto the leat.
Clara ahays starts in the top left corner and the leaf is always in the bottom right corner of the second chamber. The rushroom, on the other hand, can be at an arbitrary position within the first chamber, but it is never located nect to a tree. The turnel connecting chambers is always of the same length but it may start anywhere on the wall of the first chamber apart from the top and bottom streets within it Both chambers are identical in size.
Test whether your solution is generic by moving the mushroom to a new position and starting multiple times. Also test with all supplied example worlds.
The Permitted commands are below
PERMITTED COMMANDS
move; turnLeft; turnRight; treeleft; treeRight; treeFront; onLeaf; putLeaf; removeleaf;
JAVA
if else, for, while, do&
variables
How would this work, what can I do to have Clara find the mushroom etc, thanks
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
