Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,29 @@
|
|||
(defun draw-circle (draw-function x0 y0 radius)
|
||||
(labels ((foo (x y)
|
||||
(funcall draw-function x y))
|
||||
(put (x y m)
|
||||
(let ((x+ (+ x0 x))
|
||||
(x- (- x0 x))
|
||||
(y+ (+ y0 y))
|
||||
(y- (- y0 y))
|
||||
(x0y+ (+ x0 y))
|
||||
(x0y- (- x0 y))
|
||||
(xy0+ (+ y0 x))
|
||||
(xy0- (- y0 x)))
|
||||
(foo x+ y+)
|
||||
(foo x+ y-)
|
||||
(foo x- y+)
|
||||
(foo x- y-)
|
||||
(foo x0y+ xy0+)
|
||||
(foo x0y+ xy0-)
|
||||
(foo x0y- xy0+)
|
||||
(foo x0y- xy0-)
|
||||
(multiple-value-bind (y m) (if (plusp m)
|
||||
(values (1- y) (- m (* 8 y)))
|
||||
(values y m))
|
||||
(when (<= x y)
|
||||
(put (1+ x)
|
||||
y
|
||||
(+ m 4 (* 8 x))))))))
|
||||
(put 0 radius (- 5 (* 4 radius)))
|
||||
(values)))
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
CL-USER> (let ((buffer (make-array '(30 30)
|
||||
:element-type 'bit)))
|
||||
(draw-circle (lambda (x y)
|
||||
(setf (bit buffer x y) 1)) 15 15 10)
|
||||
buffer)
|
||||
Loading…
Add table
Add a link
Reference in a new issue