WeScheme Project - Introduction, April 19, 2012, Cardinal Forest Elementary School

WeScheme website
Bootstrap World
Racket language (Scheme)
WeScheme: The Browser is your Programming Environment (pdf paper)
Back to WeScheme Projects

  • Introduction to WeScheme

  • Practice with speaking Scheme:

    Colors available in WeScheme - no spaces, and capital letters are optional

    1. Circle

      The "contract" for Circle is: circle: Number String String -> image

      (circle 100 "solid" "red")

      (circle 50 "solid" "crimson")

      (circle 75 "outline" "orange")

    2. More contracts and images to try:
      • ; rectangle: Number Number String String -> Image
      • ; ellipse: Number Number String String -> Image
      • ; triangle: Number String String -> Image
      • ; star: Number String String -> Image
      • ; radial-star: Number Number Number String String -> Image
      • ; text: String Number String -> Image
      • ; regular-polygon: Number Number String String -> Image

      (rectangle 500 250 "solid" "chocolate")

      (text "Hello World" 100 "orchid")

      (star 100 "solid" "olive")

      (radial-star 8 8 64 "solid" "lime")

      (radial-star 8 40 64 "solid" "ForestGreen")

    3. Try your own shapes and colors

    4. Try this program. Type this into the top part of the screen "Definitions". The press the "Run" button.

      This will put two shapes next to each other on the same line: overlay/xy

      (overlay/xy
         (radial-star 8 8 64 "solid" "lime")
         100 0
         (radial-star 8 40 64 "solid" "ForestGreen")
      )
      
      (overlay/xy
         (regular-polygon 50 8 "solid" "plum")
         200 0
         (radial-star 8 40 64 "solid" "aqua")
      )
      

    5. Now make up your own picture