Skip to content

Instantly share code, notes, and snippets.

@jab
Last active November 14, 2016 05:54
Show Gist options
  • Save jab/45b9a4c5e47ff8448064562a2f69dd70 to your computer and use it in GitHub Desktop.
Save jab/45b9a4c5e47ff8448064562a2f69dd70 to your computer and use it in GitHub Desktop.
#lang slideshow
(define (empty-square color [sidelen 70])
(let ([sq (filled-rectangle sidelen sidelen)])
(colorize sq color)))
(let ([colors #("black" "red")])
(for/fold ([rows (blank)]) ([r 8])
(vc-append rows (for/fold ([row (blank)]) ([c 8])
(let* ([idx (remainder (+ c r) 2)]
[clr (vector-ref colors idx)]
[sq (empty-square clr)])
(hc-append row sq))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment