Introduction to BuggleWorld
Download the folder lab2_programs from the CS111 download directory,
on cs111.wellesley.edu. Directions for
using Fetch in CS111 are available here.
Saying "Hi" to BuggleWorld
Run the project in this folder. You may consult
overview of Code Warrior with applets.
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: Study the file Hi.java in the project which is the code we've been observing.
Check if it performs the same sequence of steps that you have come up with.
Jumping into CS
Now you're all ready to write your first BuggleWorld program! The goal is to write "CS" as shown below.

For the first assignment we will just change the code that we have been given.
-
Task 3: Comment out the code that prints Hi, i.e. put comment symbols around it:
/*
... code ...
*/
Compile and run the program. Pressing Run on the BuggleWorld applet should cause no action
(i.e. nothing is written and no buggles are created).
-
Task 4: Using the code that you have commented out as a sample, write code that writes
CS.
The best way to write a program is to write a few lines of code, then test it by
running the program, then add another few lines, test, and so on.
Try to make the picture exactly the same as shown above.
If you have time left, change your program to draw some other letters or figures.
In the end of the class
Save your work either on a ZIP disk (better), or by uploading to your drop folder using
Fetch. You can later use it as a reference. Make sure that you don't store
your files on cs111 server for too long -- when you get a chance, download them to your home computer
or save them to a ZIP disk and remove from the server.
After you have saved your work, please make sure to delete your folder on the computer that you were using and empty the trash!