Welcome to the CHICKEN Scheme pasting service

Schotter - A homage to Georg Nees added by C-Keen on Thu Sep 13 16:53:27 2018

(import scheme (chicken base) cairo miscmacros (chicken random))

(define *rotation* 0)
(define *delta* 2.7)
(define *width* 18)
(define *height* 26)
(define *box-size* 15)

(define s (cairo-pdf-surface-create "schotter.pdf" 842 1190)) ; A3
(define c (cairo-create s))

;; use millimeters as units from here on
(cairo-scale c (/ 72 25.4) (/ 72 25.4))
(cairo-set-source-rgba c 1 0 0 1)

(dotimes (y *height*)
         (dotimes (x *width*)
                  (cairo-save c)
                  (cairo-set-line-width c .3)
                  (cairo-translate c (+ 12 (* x *box-size*)) (+ 16 (* y *box-size*)))
                  (cairo-rotate c (* (if (> 1 (pseudo-random-integer 2)) -1 1)
                                     (/ cairo-pi 180)
                                     (* *rotation*  (pseudo-random-real))))
                  (cairo-rectangle c 0 0 *box-size* *box-size*)
                  (cairo-set-source-rgba c 0 0 0 1)
                  (cairo-stroke c)
                  (cairo-restore c))
                  (set! *rotation* (+ *rotation* *delta*)))

(cairo-surface-show-page s)
(cairo-destroy c)
(cairo-surface-finish s)
(cairo-surface-destroy s)

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Type in the text below:
                                
 _   _  ___  __ _ _____ __  ___ 
| | | |/ _ \/ _` |_  / '_ \/ __|
| |_| |  __/ (_| |/ /| |_) \__ \
 \__, |\___|\__,_/___| .__/|___/
 |___/               |_|        
Visually impaired? Let me spell it for you (wav file) download WAV