Using Java and BuggleWorld
Download the folder lab1_programs from the CS111 download directory,
/usr/users/cs111/download on nike.wellesley.edu. Directions for
using Fetch in CS111 are available.
Saying "Hi" to BuggleWorld
Use the AppletViewer to run the file Hi.html.
What you will see is BuggleWorld, a special microworld we have created for
CS111 students to have fun exploring programming ideas! Try clicking on a couple of
buttons to see how BuggleWorld works.
Here's a quick summary of the most important buttons:
Run | -- | runs a program in BuggleWorld |
Reset | -- | puts BuggleWorld back to its initial state
Reset must be hit before you can Run a program again. |
Step | -- | Each press of Step executes (roughly) one line of the program.
Step can not be used if the program has been Run unless BuggleWorld is Reset. |
Also note that you can just play with the BuggleWorld options without running the program involved.
You just need to create a new Buggle() before any BuggleWorld methods can be invoked.
Task 1: Write down the sequence of buttons which must be pressed to get "Hi" as shown above
(the result of hitting the "Run" button).
Task 2: Using Symantec Cafe, open the lab 1 project file,
lab1.proj. Study the file Hi.java which is the code we've been observing.
Your lab instructor will explain how the code works.
Jumping into CS
Now you're all ready to write your first program! The goal is to write "CS" as shown below.
Open up the file CS.java and enter your Java code there. In the AppletViewer,
open up CS.html. Be sure to SAVE your file often, Bring it Up to Date
and hit Reload in the AppletViewer to see your changes!