Tuesday 30 October 2012

Scratch Tutorials

Tutorial 1-
 
Change Colour Effect:
 
What does this effect do?
This effect changes the colour of the sprite.

What do each of the codes represent?
The When () Key Pressed block is a control block and a hat block and scripts that wear this will activate when the specific key is pressed (in this case, w). In this tutorial, the space bar activates how the butterfly changes it colour.

The set () Effect () block is a looks block and a stack block. The block sets the specified effect on its sprite to the specified amount. In this case the effect is colour. The number 25, states the amount of change in colour. If the number is higher, their will be a greater change in colour, but if it is a smaller number, it will only change by a little amount.



Thursday 18 October 2012

Flowcharts


1. For each of the flowcharts below describe in words what you think they will do.
It shows if the temperature is less than or greater than 32 degrees. The other one is a flowchart of a one second response to a switch.
2. Convert one of the algorithms you have created in the previous task into a flowchart, e.g.  opening a door, moving through a traffic light.

Tuesday 16 October 2012

Computer Algorithims


“Computers never do what you want them to do,

they only do what you tell them to!”

 Using the web, find definitions for the following terms and post them on your blog. Make sure the definitions relate to computers and programming. 
1.       Algorithms
 An algorithim is a step by step instruction manual, that is in a prescribed sequence to achieve a goal. It is especially used for a mathematical rule or to procedure a desired result in computing. Algorithms are the basis for most computer programming.

2.       Pseudocode
 'Pseudo' means like something, its not something, but its another name for it. Pseudocode is like a code. It is not real code, but it is a tool used by programmers to desrcibe an algorithim. It contains standard words like begin, end, hint, but it is not code and not understood by a computer.

3.       Machine Language
 Machine language is a code for an algorithim, written in a low level language that only the computer is able to understand. i.e. doesn't have English words in it.

4.       High Level Computer Language
 High level computing language contains regular words like if, then, else.etc.

5.       Flowchart
 A flowchart is another way to describe an algorthrim, but it is diagram. It uses a standard symbols. e.g a diamond symbol is used for selection.

6.       Sequence
 Sequence is the order in which the steps in an algorithim are carried out.

7.       Selection
 Selection is where in an algorithim is where you have to make a choice, usually between two items/things. e.g. is the light green? YES or NO. Computers are nothing more than just switches.

8.       Repetition
 Repeating a step over and over again until your goal is achieved or a condition is met.

Then with the aid of class discussions, write an algorithm for the following processes; In your algorithm write each step of the process on a new line. Remember not to assume the computer knows anything.

1.       opening a door and entering a room.

Turnn left 90 degrees
Walk 5 steps straight
Turn 90 degrees left
Walk two steps forward
Grab the hand with your right arm
Turn the handle clockwise
Pull the door towards you

2.       Negotiating traffic lights as you drive down a street.

Is the light green?
If Yes, continue driving, if  No go to next question
Is the light yellow?
If Yes, slow down, if No go to next question
Is the light red?
If Yes, stop