Last active
January 15, 2016 20:29
-
-
Save vydd/6062bc9369fa969f2ad7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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