Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import kareltherobot.*;
- import java.awt.Color;
- /**
- * Write a concise summary of class HarvestAdvancedTester here.
- *
- * @author Jason Yang
- *
- * @version 2/11/2017
- */
- public class HarvestAdvancedTester implements Directions
- {
- /**
- * Creates and positions a robot.
- *
- * @param args arguments from the command line
- */
- public static void main(String [] args)
- {
- World.reset();
- //World.readWorld("C:/worldFilesDOS/fig3-2.kwld"); // use for PC
- World.readWorld("/worldFilesDOS/fig5-3.kwld"); // use for MAC
- /* Sets up the GUI for the Karel world. */
- World.setVisible(true);
- World.setDelay(20);
- World.setSize(10,10);
- //World.showSpeedControl(true); // use setDelay method as above
- WorldBuilder myBuilder = new WorldBuilder(false);
- /* Creates a robot */
- HarvestAdvanced karel = new HarvestAdvanced(2, 2, East, 0);
- karel.setUserPause(true); //enables use of userPause
- karel.userPause("start. Press [enter/return] to start");//pauses
- /* Calls the method(s)to be tested. */
- karel.run();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement