Wednesday 11 April 2012

Tutorial 4 - Question 5

Video:
++++++++++
Code:
  world.my first method ( )
    No variables
       iceSkater move forward 1 meter
  iceSkater turn right 0.25 revolutions
  iceSkater move forward 5 meters
  iceSkater2 move forward 6 meters
  Loop 2 times times
       Loop 4 times times
       iceSkater turn right 0.25 revolutions
  iceSkater move forward 5 meters
  iceSkater2 turn right 0.25 revolutions
  iceSkater2 move forward 5 meters
  iceSkater turn left 0.25 revolutions


Summary:
IceSkater 2 and Ice Skater 1 will move the Square.

Tutorial 4 - Question 4

Q4. Consider the following loop. Describe what the ice-skater will do.


Ice Skater repeated jumping 5 times and turns left, moving up 0.5 meter (Ending points) and move down 0.5 meter (Starting points).  Every Step before Ice Skater Jump up, Movement of Ice Skater turning left will keep increase 1 meter / +1 meter.
Like example   First Turn Left (0+1) = 1 Meter
                          Second Turn Left (1+1) = 2 Meter

Tutorial 4 - Question 3

Q3. Sometimes the meaning of what a programmer wrote isn’t what s/he intended. We then say the program has a logic error. Consider the following loop – if the programmer intended the loop to run 3 times, does it have a logic error? How many times will the loop run?

Answer:

  • Yes, It contain a logic error in above code. User want to loop 3 times.
    First error:-
  • index start from 5 up to (but not including) 2 times.
  • How the user want to loop 3 times, and it start from 5 and end in 2
    Second error:-
  • incrementing by 1 = (index + 1 )
    User should input (Decrementing by 1 = (index -1)

Tutorial 4 - Question 2

Summary Story:

Penguin Move Triangle Shape - 3
Penguin Move Hexagon Shape - 6

Movie :

Process Step:
  • Using a loop Method to enable the penguin to repeat it's action until a triangle is formed.
  • Under the loop tab, I made the penguin walk a certain distance and turn 1/3 revolutions.
  • The loop is adjusted to repeat the actions 3 times times only.
  • For the hexagonal shape, I did the same loop as the triangular shape but making the penguin turn 1/6 revolutions instead of 1/3.
  • I set the loop 6 times.

Tuesday 10 April 2012

Tutorial 4 - Question 1


Question 1:



Summary Process:
  • First Create the object is A dancer. 
  • Than using the Loop Method to let the dancer repeating dance.  
  • The dancer move up and turn 1 revolution - 1 round in the sky and going down by keep repeating 5 times. And Stop. 













Sunday 8 April 2012

Tutorial 3


Movie: 

Mana and the Fire Hydrants
 

This is Tutorial 3 which is the Fire Hydrant and Mana. When key S is type Mana walk towards the Fire Hydrant but when Mana is equal and less than 1 meter of Fire Hydrant, Mana will turn away and move to the other Fire Hydrant.  Mana wont bang to the Fire Hydrant. 

Processing Doing:

In this tutorial, the objective was to make sure Objects cannot pass through one another.

  • First we create new methods to enable Mana to turn left by pressing Z, right using X or walk forward using S.
  • Under the Method to walk forward [S Key] , we use the 'If Else' function and inserting '[Either [Mana distance to Fire Hydrant1 <= 1] or [Mana distance to Fire Hydrant2 <= 1], or both].
  • If true, Mana turns back and walks forward 1 step.
  • If false, Mana walks forward one step.
  • This way, when Mana is close to the the fire hydrant, she turns around and moves forward when S key is pressed..
  • Thus, she will not pass through any of the fire hydrants. 

Tutorial 2 - Question 3

Music Dancing

Short Summary:
This is tutorial 2 which is the musical chair games. There are 3 people in this game with 2 chairs and when the music start they need walk around the chair but when the music stop then need to sit on the chair the one who doesn't sit on the chair will be out of the game the game continue until it left on.