by r8533292 · 2y ago · 0 comments
(defun bresenham (a x0 y0 x1 y1 &aux dx dy d y)
#◇dx:x1-x0,
dy:y1-y0,
d:2*dy-dx,
y=y0◇
(loop for x from x0 to x1
do #◇a[x,y]:1,
if d>0 then
(y:y+1,
d:d-2*dx),
d:d+2*dy◇))
you can make the code above fully operational in common lisp using dispatch macro on a unicode character, so i've been experimenting with such infix mode in my private code. i'll leave the judgement over whether or not this increases readibility.No comments yet.