Presentation is loading. Please wait.

Presentation is loading. Please wait.

Monkey See, Monkey Do. Important Turn on Java-like syntax option in Alice, if is not on already.

Similar presentations


Presentation on theme: "Monkey See, Monkey Do. Important Turn on Java-like syntax option in Alice, if is not on already."— Presentation transcript:

1 Monkey See, Monkey Do

2 Important Turn on Java-like syntax option in Alice, if is not on already.

3 Revision - Objects Our world is made up of objects These objects are computer models of real world objects They have properties (variables) that define the state of that object They have behaviours they can act out These behaviours are a list of instructions or code To manipulate our objects, we must manipulate an object’s variables or have it carry out actions.

4 Alice Objects All Alice objects are 3D models that are visible in your World Most Alice methods/behaviours are animations that you wish these models to carry out You can manipulate the starting positions of objects by mouse Animate characters by writing and calling methods

5 Alice Objects Alice objects come with many default variables and methods – default methods cannot be edited Alice provides a number of default boolean expressions - called questions Alice objects can be made up of a number of sub-objects. These can be manipulated independantly

6 Revision - Methods A method is a block of code (list of instructions) By default, the code is executed one line at a time We can change this using execution control structures Methods can have parameters

7 Alice Methods Alice methods also contain a block of code Code is written by dragging tags from one location and dropping in another We can create temporary variables for use during method execution We can define paramters for our method’s execution

8 Revision – IF/ELSE & boolean statements IF statements allow our computer to make a choice We use boolean statements or questions Outcome dictates which block of code executes

9 Alice IF statements Drag the IF tag from the top of method editing window Drag in a question Drag in code to fill in the other two outcomes

10 Revision – loop A loop statement loops a number of times The code is repeatadly executed

11 Alice loop Drag the loop tag from the top of method editing window Choose how many times you want the code to execute Drag in code to fill in the other two outcomes

12 Revision – While While statements loop until the testing condition is false This condition is tested prior to the next loop executing

13 Alice While loop Drag the while tag into the code area Drag in a question Drag in code to fill in the while loop Make sure while loop ends at some stage

14 Revision – Parrallel Normal execution is one line at a time By using the do together command, we can execute multiple lines at once In Java, multiple execution of code is possible – although somewhat difficultl

15 Dot notation If you have correctly set Java-like syntax, you will see dot notation Monkey.head is the Monkey object’s head object Monkey.head.color is the Monkey object’s head object’s color This notation allows the computer to work out who owns what


Download ppt "Monkey See, Monkey Do. Important Turn on Java-like syntax option in Alice, if is not on already."

Similar presentations


Ads by Google