Background

Before you begin you must set up this project (Eclipse or Netbeans) for your own machine. 
Instructions are below. 

This project was begun by Cay Horstmann who set up the basic world structure and the graphics. 
It was then taken over and extended by Joe Bergin, who put it more into the Karel framework as defined in the book.

There are a large number of world files here, and all of the worlds defined in the Karel J Robot simulators 
will work unchanged. They are just text files in a defined format.

Karel Programs from other versions should be easy to import. In general, the instructions are as follows.

For chapter two of the book, either edit or duplicate the TestWorld.java file. Create your UrRobots 
as we show in the sample. Add walls and beepers in the setTheStage() method.

Put the robot task into the run() method.

Edit the KarelProgram.java file so that the constructor looks like this:

public KarelProgram() { 
// Create an object here from a class that extends KarelWorld. 
// The setTheStage message is required to set up all of your world 
// elements 

   scene = new TestWorld();

   scene.setTheStage();
}

Now you can run the KarelProgram as an Application.

After chapter 2, you will be building your own robot classes. Create a class, such as StairClimber.java 
for your work, extending some robot class such as UrRobot. Your class should be in package alice.kareluser.

Then build a World class extending KarelWorld, such as the StairWorld.java file. Put the task for your 
robots into the run() method of your new class, as above, and the set up the scene by putting walls, 
beepers, and your robots into the world using the setTheStage() method. Then make the constructor of 
KarelProgram create a new world with your own name (scene = new MyWorld(); say)

Then you can run KarelProgram as above.

You will find JavaDocs for all of the built-in features in the karelWorldDocs folder. 
If you create JavaDoc for your own code it will be in the doc folder.

Worlds are in the worlds folder

Your code should be in the alice.kareluser package, hence in that folder.

Features:
	The RemoteControl class creates a controller and a robot that it controls. You can make the robot carry out
	basic actions (move, turnLeft...) by pressing buttons in the controller. Don't forget to get the reference
	to the robot from the controller object and add it to your world, however. 
	
	The WorldBuilder class has its own main method. To run it create a new run configuration and set it up 
	as above (set the path) with WorldBuilder as the main class. The code is included in the jar file. When
	run it shows a version of the world, but with a small blue square at each corner of the world (actually 
	in only as section of the world a fixed number of streets and avenues square). 
	
	Select a tool from the dialog (Beeper, East-West Wall, ...) and then click on one of the target squares
	to place that item. The "I" key switches the Beeper tool to an InfiniteBeeper tool. When a tool is
	selected, the "R" key gives you a remove tool instead (that will remove both walls and beepers). If you
	select a tool in error, you can select another, or the "space" bar will unselect that tool. 
	
	The dialog also has a Save option to save the world, and a Read option to read a world for modification. 
	
	When the simulation is running, you can click in the background and then utilize the arrow keys for 
	control:
	  Up-Arrow doubles the speed of the simulation
	  Down-Arrow halves the speed
	  Left-Arrow moves the camera back (out) a bit
	  Right-Arrow moves the camera forward (in) a bit

--- Initial Setup (Eclipse) 
Open Eclipse. I suggest a new workspace, but it isn't essential. Select Import from the File menu. Then click 
General, then click Import Existing Projects into Workspace. Click Next. Click Select Archive File, 
and Browse... to the distribution zip file. Then click Finish. Your project will be imported, but it isn't 
ready for use yet. 

Now try to run alice.kareluser.KarelProgram.java as a Java Application. 

The first time you run it will fail. You may get an error printed in the console telling you that the system 
has placed a long string similar to

-ea -Xmx1024m -Djava.library.path="/Applications/Alice3Beta/ext/jogl/lib/macosx-universal"

into your clip board. 

Now open the Run Configurations for your application (from Run Menu). It should show a configuration for 
the run that just failed, showing KarelProgram as the Main File. Select the Arguments tab and paste the 
following string into the VM Arguments. (This is a one-time operation. Note that the path is relative, 
not absolute.)

-ea -Xmx1024m -Djava.library.path="ext/jogl/lib/macosx-universal"

where the last element (after the final /) is replaced by the appropriate OS-architecture string 
(it is actually a link to a directory inside the project distribution that contains specific files for 
your machine). The choices are as follows:

linux-amd64
linux-i586
macosx-ppc
macosx-universal
solaris-amd64
solaris-i586
solaris-sparc
solaris-sparcv9
windows-amd64
windows-i586

Then click Apply and Run and it should run ok. Each configuration will need to be set up this way.
If you should get an error that the gallery (or some element of it) can't be found, then point it to 
the gallery file within your project. 


--- Initial Setup (NetBeans) The zip file KarelAliceStudentProjectNB.zip is a zipped netbeans project. 
Install this on your disk in an accessible place.
