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. 

Saturday 7 April 2012

Tutorial 2 - Question 2


This is tutorial 2 - Question 2 which is Rabbit and Fan. This story is about When the fan button is switch On the Fan.Blade will start move, and Rabbit Ear will move Backward. When the Switch button is off, the Fan.Blade is Not turning, the rabbit ear is back to normal.

Video:

Summary Progress:
  1. Input two object which are Fan and Rabbit.
  2. Create two event method which are "When Mouse Click On Button" and "When Mouse Click Off Button".
  3. In the Event On button
  • Fan.highButton is set to showing to False and fan.offButton is set to showing to True.
  • Using 'While fan.offButton. is Showing', we add a command under it which is 'fan.blades roll left 1 revolution.
  • This means that when the off button is showing, the fan blades will keep rotating as long as the fan off button is not showing.
  • In the same time, Using Do together, to set the Movement of Rabbit Ear.  
    4. In the Event Off Button
  • We set fan.highButton is set to showing toTrue and fan.offButton is set to showing to False.
  • It means when Offbutton is press down, the movement of fan will stop and rabbit ear will back to Original.

Tutorial 2 - Question 1



This is tutorial 2 which is Mana and magnet. This story is about when Mana walk near to the magnet the object will attract to the magnet BUT when Mana walk near to the car the magnet and Mana herself are attracted to the car and say "Whoa!!"
Movie:
 

  1. Input the Object - Mana, Toaster , Magnet, Knife and Car. 
  2. Mana(Object) Move infront (Methods) - Do together movement of hand and leg)  to the Magnet(Object).
  3. Mana(Object) Hold (Methods) / Take up the Magnet(Object). By using Vechile Method (Magnet set vechicle to the Mana). It mean when mana move, magnet will follow.
  4. When Magnet(Object) Point to the view(Methods) 1st Magnetic Item (Toaster) - Object Toaster(Object) Turn the Face(Methods) to Magnet(Object). Toaster(Object) Move Forward(Methods) to the Magnet(Object).
  5. Other Magnetic Item will follow the Step 4. 
  6. Until the Mana(Object) use the magnet(Object) point(Methods) to the car(Object). Mana(Object) move forward (Methods) to the car(Object) and say (Method) "Whoa".