Getting used to Parson's Problems: Turning To Face A Direction

DIRECTIONS:

Construct a working program by dragging & dropping lines from the left to the right. You'll need to change the order of the lines and you'll need to adjust the indentation correctly.

You should have the robot keep turning leftwards until it faces Direction.NORTH, then move it forwards one space, and then stop

If you'd like a bit more information about the getDirection() command you can find it here.

!= means 'not equal' in Java.

   import becker.robots.*;

   public class ICE_05_Demo_Run_To_Wall extends Object
   {
      public static void main(String[] args)
      {
         City wallville = new City(6, 12);
         Robot rover = new Robot(wallville, 4, 0, Direction.WEST, 0);
         new Wall(wallville, 4, 10, Direction.EAST);
      
      // FIX THIS PART!!!
      }
   }	
}

}

Check your work by clicking on the button labeled "Get Feedback" at the bottom of this page.