Monday, April 28, 2008

Tutorial 2 - Supplementary - Problem 3



Problem 3:



  • The wizard is surrounded by 3 trolls who want to DESTROY him!

  • The wizard can banish each troll by turning to face each and saying "abracadabra! Away troll!"

  • Then the troll will disappear.


(Rules: Must create 3 new methods, one each, to banish each troll).

Tutorial 2 - Supplementary - Problem 2



Problem 2:


  • You are given some Alice code. Run it and see what happens.

  • But the code is all written in the World.my first world method.

  • Your boss wants to you put all the code into separate methods.

  • You need to break the code into smaller methods without changing anything in the original code.



(Question: How many methods should you create?)

Tutorial 2 Supplementary - Problem 1


Download the file:

Problem 1:


  • randomGuy2 Wants to Ask Girl(Kelly) out.

  • randomGuy2 moves to Girl (Kelly) and asks her out.

  • Then both go to the amusement park (carousel).

    (Rules: Cannot type in any "meters=???". Must use "distanceto" function).