; draw-v-lines
(define (draw-v-lines start skip stop height)
(cond
[(>= start stop)
(draw-solid-line (make-posn stop 0) (make-posn stop height)
GRID_COLOR)]
[else
(and
(draw-solid-line (make-posn start 0) (make-posn start height)
GRID_COLOR)
(draw-v-lines (+ start skip) skip stop height))]))
; (x0, y0) is the origin. sx and sy represent one grid size
(define (draw-grid x0 y0 sx sy)
(and
(draw-v-lines (- x0 (* (quotient x0 sx) sx)) sx (+ (* (quotient (- WX x0) sx) sx)
x0) WY)
(draw-h-lines (- y0 (* (quotient y0 sy) sy)) sy (+ (* (quotient (- WY y0) sy) sy)
y0) WX)
(draw-solid-line (make-posn 0 y0) (make-posn WX y0) AXIS_COLOR)
(draw-solid-line (make-posn x0 0) (make-posn x0 WY) AXIS_COLOR))) 47