Question: your task is to make Clara move through the middle row in the world shown in Figure 1. and place a leaf in any
your task is to make Clara move through the middle row in the world shown in Figure 1. and place a leaf in any cell that has a tree either above or below this cell. Clara has to stop when she detects that there is a tree in front of her. The result should look similar to Figure 2. * Figure 1. Figure 2. Starting from this problem, there will be restrictions on commands that you can use in your solutions. Those restrictions will appear at the top of MyClara file as shown in Figure 3. In this problem you are only allowed to use commands shown in Figure 3. Notice that you are not allowed to use turnLeft() and turn Right() commands. 2 3 4 1/* PERMITTED COMMANDS move(); treeLeft (); treeRight(); treeFront (); onLeaf (); putLeaf (); removeLeaf (); stop(); JAVA if, else */ Figure 3. Your solution must be generic and has to work with all supplied example worlds. This means that before submitting you must test your code with all supplied worlds and it must correctly work in all of those. You should also aim at making sure that the code would work with all similar worlds with similar properties (beyond the provided examples).
Step by Step Solution
3.38 Rating (151 Votes )
There are 3 Steps involved in it
It seems like you want to create a program or script to make Clara move through a gridlike world re... View full answer
Get step-by-step solutions from verified subject matter experts
