Skip to content

Instantly share code, notes, and snippets.

@vydd
Last active January 15, 2016 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vydd/6062bc9369fa969f2ad7 to your computer and use it in GitHub Desktop.
Save vydd/6062bc9369fa969f2ad7 to your computer and use it in GitHub Desktop.
(defun render-grid (grid cell-size)
(with-identity-matrix
(with-pen (make-pen :fill (gray 0.2) :stroke +white+)
(dolist (row grid)
(with-current-matrix
(dolist (cell row)
(rect 0 0 cell-size cell-size)
(with-font (make-font :color (hash-color (char-code (elt cell 0)))
:size cell-size)
(text cell 0 0))
(translate cell-size 0)))
(translate 0 cell-size)))))
(defsketch term (:debug :scancode-f1) ()
(render-grid '(("a" "b" "c")
("d" "e" "f")
("g" "h" "i"))
(/ width 3)))
;(make-instance 'term)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment