More Conditionals TopDraggingColors and Random Numbers

Colors and Random Numbers

  1. A new version of the scribbler program that draws in four different colors.

    Click on Scribble4Color to show the example. It also illustrates the use of the if-then-else statement.

  2. A fancier version of the scribbler program that generates a random color by using a method that returns a randomly chosen color. Alternatively we could have chosen a color at random by using a random number generator that selects a number between 0 and 255.

    Click on ScribbleColor to show the example.


More Conditionals TopDraggingColors and Random Numbers