Вы находитесь на странице: 1из 9

1

“Angry Birds”

When we play the Angry Bird game on site (www.studio.code.org/hoc) .


We learn how to code in program for an object which we make for games or
for applications. In this game different types statements were used in this
game i.e. For loop , If and while.

 Puzzle 1 :

o First code were coded to move angry bird towards the bad
pig.

 Puzzle 2 :

o To move Angry Bird towards Bad Pig three times which is


separately coded.

 Puzzle 3 :
2
“Angry Birds”
o Move Angry Bird two times move,which is
coded separately moveforward(); , after
moving two time it can be turn
( turnrigh(); ) and again move
( moveforward(); ) to trace the silly Pig.

 Puzzle 4 :

o in this code programmer coded to move,turn again move and turn to move towards
green evilness.
 Puzzle 5 :

o To move towards bad Pig , the angry bird


turn,move,turn,move,move,move,turn,move to for finding green bad Pig.
 Puzzle 6 :
3
“Angry Birds”

o In this puzzle the Angry Bird to reach green bad pig in two blocks using For loop to
move ( moveforward(); ) 5 times.
 Puzzle 7 :

o Angry Bird can get the Green Intruder to turn ( turnright(); ) , and using for loop to
move 5 times.
 Puzzle 8 :

o Angry Bird banish this bad piggy using the fewest number of blocks. Try using
more than one "repeat times" block. That is move ( moveforward(); ) Angry Bird 2
time in a row we use for loop, then turn right using turnleft(); again move
( moveforward(); ) using for loop to get the green Pig.

 Puzzle 9 :
4
“Angry Birds”

o Using for loop for two time move ( moveforward(); ) , ( moveforward(); ) and
turn ( turnRight(); ). To reach the bad Piggy.
 Puzzle 10 :

o In this puzzle the while loop used to move angry bird until reached to green intruder

For this they can moveforward(); toward green intruder to get it.

 Puzzle 11 :

o In this puzzle the while loop used to move angry bird until reached to green intruder
for this they can move ( moveforward(); ) , move ( moveforward(); ) ,
turn ( turnLeft(); ) Angry Bird toward green intruder to reach it.
 Puzzle 12 :
5
“Angry Birds”

o In this puzzle the while loop used to move angry bird until reached to green intruder
for this they can move ( moveforward(); ) , turn ( turnLeft(); )
move ( moveforward(); ) , turn ( turnRight(); ) in the while body, Angry Bird toward
green intruder to reach it.
 Puzzle 13 :

o In this puzzle the while loop used to move angry bird until reached (notFinished()) to
green intruder for this they can turn ( turnRight(); ), move ( moveforward(); ) , turn (
turnLeft(); ), move ( moveforward(); ) in the while body, Angry Bird toward green
intruder to reach it.
6
“Angry Birds”
 Puzzle 14 :

Using the new "if" block to get decide when to turn. Need only one more block, when
the path is left then it can turnLeft(); and move until to get the flower.

 Puzzle 15 :

In this puzzle we used both while loop block and if conditional block , they can
moveForward (); when the path is right the If block now true then it can turn
( turnRight(); ) after turning right again it can moveForward(); until it can reach to Sun Flower.
7
“Angry Birds”
 Puzzle 16 :

In this puzzle we used both while loop block and if conditional block , they can
moveForward (); when the path is right the If block now true then it can turn
( turnLeft(); ) after turning right again it can moveForward(); until it can reach to Sun Flower.

 Puzzle 17 :

In this puzzle we used both while loop block and if conditional block , they can
moveForward (); when the path is right the If block now true then it can turn
( turnRight(); ) after turning right again it can moveForward(); until it can reach.
8
“Angry Birds”
 Puzzle 18 :

o In this puzzle we used both while loop block and if-else conditional block , they can
moveForward (); if the if the statement true when the path is forward the If block
false the else statement execute then it can turn
( turnLeft(); ) after turning Left again it can moveForward(); until it can reach to.
 Puzzle 19 :

o In this puzzle we used both while loop block and if-else conditional block , they can
moveForward (); if the if block is true , if the path is forward ,the If block
false the else statement execute then it can turn
( turnRight(); ) after turning right again it can moveForward(); until it can reach to.
9
“Angry Birds”

 Puzzle 20 :

o In this puzzle we used while loop block, if else conditional block , if else conditional
block they can moveForward (); if the if the statement true when the path is forward
the If block
false the else statement execute then it can turn
( turnLeft(); ) after turning right again it can moveForward(); until it can reach to.

Вам также может понравиться