Junkbots - Computational Concepts
Activity 2 - Learning some new concepts
Before
starting to program the game, we need to understand the 4 main programming
concepts. These are Input, Output, Conditional and Looping.
· Inputs: This is anything that you;
the user, tells the computer. An example could be you moving the arrow keys, or
you typing something on the computer screen. All of it is data which you pass
to your computer.
· Output: Opposite to inputs, this is
something the computer tells you. It could be some text on your screen, or an
image. For example, if you pressed an arrow key to control a character in a
game, the output would be the character moving on the screen
· Conditional: This is basically a
question the computer asks itself. If you want your game to end when all the
targets are hit, the ‘condition’, you’d program the game to ask itself “are all
the targets it?”, IF true then end the game, IF false then don’t end the game.
· Looping: This is slightly similar to
a condition. It means that the code will keep repeating until a certain ‘condition’
is met, or it will repeat forever to check if something is true or false. For
example, in our game, the computer will keep asking itself if all the targets
are hit, over and over again. When all the targets are hit, the loop will end,
and so will the game.
Draw a
line to match up the words with their meanings:
Inputs |
Data the computer gives you |
Outputs |
Testing to see if something is true or false |
Conditions |
Data you give to the computer |
Loops |
Looping through instructions until a condition is
met |
Comments
Post a Comment