TopColors and Random NumbersMore Conditionals

More Conditionals

  1. We introduced conditionals with a (rather lame) game of basketball where we just had to click in a hoop to score.

    To make our basketball game a bit more exciting, let's add something that is clearly missing from our first version -- a ball. In particular, we would like to change the game so that to score you have to drag the ball into the basket.

    Click on EvenBetterBasketBall to show the example.

  2. Our first attempt at writing Pong. Unfortunately, the paddle doesn't stay in the boundaries. (Don't worry about the ball, we'll come back to that later.)

    Click on PongUnbounded to show the example. (We do not yet make the code for the ball available.)

  3. Our second attempt at writing Pong. This time the paddle stays in the boundaries.

    Click on PongPaddleBounded to show the example.


TopColors and Random NumbersMore Conditionals