HOME | DD

Published: 2015-02-07 20:17:57 +0000 UTC; Views: 379; Favourites: 0; Downloads: 0
Redirect to original
Description
(eval-when (:compile-toplevel :load-toplevel)(require 'vecto))
(in-package :vecto)
(defun j (x n)
(+ (- x n) (random (* 2 n))))
(defun render (file)
(let* ((w (/ 10800 1)) (h (/ 7200 1)) (s (coerce (/ w 128) 'float)))
(with-canvas (:width w :height h)
(set-rgba-fill 1 1 1 1)
(rectangle 0 0 w h)
(fill-path)
(set-line-cap :round)
(dotimes (q 3)
(do ((x 0 (incf x s)))
((> x w))
(do ((y 0 (incf y (random s))))
((> y h))
(set-line-width (random (/ s 3)))
(set-rgba-stroke (random 1.0) 0 0 (random .5))
(move-to (+ x (+ (- s) (random (1+ (random (* s 4)))))) y)
(line-to (+ x (+ (- s) (random (1+ (random (* s 4)))))) (+ y s))
(line-to (+ x (+ (- s) (random (1+ (random (* s 4)))))) (+ y s))
(stroke))))
;; signature
(set-rgba-fill 0 0 0 1)
(set-font (get-font "~/OCRABold.ttf") (/ w 128))
(draw-string (- w (/ w 32)) (/ h 32) "X")
(fill-path)
(save-png file))))
;(let ((random-state (open "random-state.lisp")))
; (setf *random-state* (read random-state))
; (close random-state))
(render "x-3.png")