1 / 16

Jeroo Code

Jeroo Code. Overview. In this presentation we will discuss: How to write code in Jeroo How to run a Jeroo program. Review: Step 1. Create the Environment. To start: Open an existing Island File Or Create your own Island Add or remove: Flowers Nets Water Land

obuntin
Download Presentation

Jeroo Code

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Jeroo Code

  2. Overview • In this presentation we will discuss: • How to write code in Jeroo • How to run a Jeroo program

  3. Review: Step 1. Create the Environment • To start: • Open an existing Island File • Or Create your own Island • Add or remove: • Flowers • Nets • Water • Land • You can save and re-use your islands.

  4. Step 2. Write the program • You can create and control up to 4 Jeroos. • Your program must have a main method (Sub) • Each Jeroo gets a name when it is created • Refer to them by name to send them a message

  5. The DIM statement • Dim Alfred as Jeroo = new Jeroo() • A new Jeroo is created and assigned the name Alfred. • Alfred will appear in the top left corner of the island, facing east. • All statements in the main program must specify which Jeroo is to act, and what it is to do. • Alfred.toss() • tells Alfred to toss a flower into the space ahead.

  6. Write the code to create a new Jeroo named Neo Write the code to make Neo hop Write the code to make Neo turn right. Coding practice Answers: • Dim Neo as Jeroo = new Jeroo() • Neo.hop( ) • Neo.turn(right)

  7. hopping • hop() alone means hop once in the direction the Jeroo is facing • hop(n) will tell the Jeroo to hop n times • Example: • alexandria.hop(3) • is the same as: • alexandria.hop() • alexandria.hop() • alexandria.hop() • Write the code to make Neo hop forward 5 times . • Neo.hop(5)

  8. Step 3: Run the program • Animation shows Jeroos moving around the island • Source code highlights while executing • You can run one step at a time • Run the whole program continuously • Pause at any time • Go back to the beginning,or stop

  9. Watch a program running • the code is highlighted • the Jeroo acts (watch the video of a Jeroo program while it runs above) (it will loop until you stop it, if the video won’t run, demonstrate in Jeroo)

  10. Step 3: Run the program • 2 different language modes • You want VB.net

  11. What is the logic error here? Go to Jeroo and demonstrate and fix Alexandria

  12. Your First Program • Start Jeroo • Enter your name • 1. Create the environment • Clear the island layout. • Place a flower at location Row 3 Column 2 • 2. Write the program • Create a Jeroo with your name • Tell it to hop to the flower • Tell it to pick the flower • 3. Run the program • If it doesn’t work, fix it!

  13. The program goes in the main method • Create a Jeroo with your name • Dim MrsM as Jeroo = new Jeroo( ) • It will appear in location 0,0 facing EAST with no flowers in its pouch. • Tell it to hop onto the location with the flower • MrsM.hop( ) • You must address your Jeroo by name. • repeat this statement each time you want your Jeroo to hop • MrsM.turn (relative direction) • You must turn either LEFT or RIGHT (capitals don’t matter) • Tell it to pick the flower • MrsM.pick( ) • It will stop when it reaches the end of the program.

  14. Top Grade • Write a program to get a Jeroo from one end of your original letter island to the other using AT LEAST 8 programming steps. • Add a comment to your code with your name in it and print the code. • (comments start with ‘ just like in visual basic)

  15. Choosing directions • Four relative directions • LEFT • RIGHT • AHEAD • HERE • Four compass directions • NORTH • SOUTH • EAST • WEST When you turn, you must specify a relative direction

  16. The End

More Related