<p>Hi guys so I'm trying to figure out the answer to this gridworld Free Response question (there's three parts a, b, and c) and need some major help! Can someone please provide the answers to the three parts and EXPLAIN how they got to their answer? I have an actual test on Monday so please help ASAP!</p>
<p>I don’t have actual code (I don’t have gridworld atm), but I can explain how to answer it?</p>
<p>(a) First in your move() method, check if the bug can move by calling canMove()
If it it is true, check turnRight. If false, move your bug diagonally left (actors have that method built in using degrees: setDirection(int newDirection) OR using the Location class’s constants and then to move: moveTo(Location newLocation) ) check canMove() again, if it is true, turn right.</p>
<p>If canMove() returns false, call the turn() method then loop through what i just stated before. </p>
<p>(b)
THis is basically the same as the original bug’s canMove() method, just change the location that the bug is checking to the diagonal (left diagonal if turnRight==false, right if turnRight==true).</p>
<p>(c)
setDirection(HALF_CIRCLE);
is basically it. </p>