Home Page TextPad Page Lejos Page Moodle Page Karel Page Install Rite Page Links Page About Page
Toolbar Graphic
DIRECTIONS:

These directions assume that you have already downloaded, installed and used Sun Java with the IDE of your choice. Additionally, you should have already downloaded, installed and used Karel J. Robot. If not, visit the Karel J. Robot website and follow their installation directions before you continue.

HOW TO USE THE PiCalcRobotDriver.java program:

  1. Download either this PiCalcRobot.zip file or this PiCalcRobot.exe file.
  2. Place the three ".java" files and the one ".kwld" file in a folder on your hard drive.
  3. Open the "PiCalcRobotDriver.java" file in your favorite Java editor or IDE.
  4. Read the extensive comments in this file and adjust the 3 main setting.
  5. Compile and run "PiCalcRobotDriver.java".
  6. Analyze the "PiCalcResults.txt" file to see the Pi calculation results.
  7. The program APPENDS to the file each time, so all run results are kept for future reference.
  8. Change 3 settings found in "PiCalcRobotDriver.java" for a variety of Pi calculation trials.
  9. Try a longer run (in the Billions?) and report your results :-)

WORKSHEET:

If you are getting class credit for this activity, your instructor may require completion of the PiCalcRobot.pdf worksheet. Click HERE to get it.

WHAT YOU MIGHT SEE:

If you turn on sample points, the robot will "mark" selected hits inside the circle. The ratio of hits inside the circle to hits outside the circle is one fourth Pi!! The images below show the "Progress Robot" which tracks progress left to right across Karel's world. "Karel", the robot that graphs sample points, is in the middle of the screen.

The Image below shows a run with Sample Points set to 500...

The Image below shows a run with Sample Points set to 5000. This is NOT recommended as it *greatly* slows the program. This example was run for debugging and information purposes.

Home | TextPad | Lejos | Moodle | Karel Robot | Install Rite | Links | About