Point = type x Int y Int Color = type {r Int; g b a Int} Pixel = type {Point Color} # Pixel = Point * Color + = (a, b: Point) Point x:((x a) + (x b)) y:((y a) + (y b)) - = (a: Point, b: Point) Point ((x a) - (x b)) y ((y a) - (y b)) * = (a, b: Point) Point.((x a) * b, (y a) * b) width = 1280 # = for constants, : for variables, := for mutation height = 720 screen = Array Pixel size [width height] from 0 to height do (x: Int) from 0 to width do (y: Int) p = Pixel x:x y:y # In ifs, = equals ==. (r p) := if (((x + y) % 2) = 0) then 100 else 255 screen.(x).(y) = p match cheerio with Pixel (a Int) total += a Error (msg String) printerr msg # Types: Uint8, Int8, Uint16, Int16, Uint32, Int32, Float32, Float64, # Float, Int, Uint, Double, Void