Referenced from lesson Reviewing the Basics

Buggy Code Correct Code / Explanation

1

SECONDS = (7)

STRING = my string

2

SHAPE1 = circle(50 "solid" "blue")

SHAPE2 = triangle(75, outline, yellow)

3

# triple :: Number -> Number
# Multiply a given number by
# 3 to triple it

examples:
  triple(5) = 3 * 5
  triple(7) = 3 * 7
end

4

fun triple(n):
  3 * n

5

ys :: Number -> Number
# Given a number, create a solid
# yellow star of the given size

examples:
  ys(99) is star(99, "solid", "yellow")
  ys(33) is star(33, "solid", "yellow")
end

ys(size):
  star(size "solid" "yellow")
end

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, and 1738598). CCbadge Bootstrap:Reactive by Emma Youndtsmith, Emmanuel Schanzer, Kathi Fisler, Shriram Krishnamurthi, Joe Politz and Dorai Sitaram is licensed under a Creative Commons 4.0 Unported License. Based on a work at www.BootstrapWorld.org. Permissions beyond the scope of this license may be available by contacting schanzer@BootstrapWorld.org.