Bitmap/Midpoint circle algorithm: Difference between revisions

m
use <lang>
(CL code)
m (use <lang>)
Line 206:
Based upon the OCaml version.
 
<prelang lisp>(defun draw-circle (draw-function x0 y0 radius)
(labels ((foo (x y)
(funcall draw-function x y))
Line 234:
(+ m 4 (* 8 x))))))))
(put 0 radius (- 5 (* 4 radius)))
(values)))</prelang>
<prelang lisp>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)</lang>
<pre>;; edited for your convenience
(( )
( 1 1 1 1 1 1 1 )