finish comments

This commit is contained in:
Nico 2022-04-01 23:14:22 +01:00
parent 0681ec7ba5
commit e4cd2808c2
1 changed files with 2 additions and 1 deletions

View File

@ -49,7 +49,8 @@
; given a point that is the top-left corner of a square on the grid, returns the amount of edges surrounding that square.
(define (count-square p g)
; explanation:
; for every item in the grid (g), test it against every edge of the box
; for every item in the grid (g), test it against every edge of the box for equality. these form a list, which is then folded into #t or #f if any match.
; then only those that match are kept and this list is checked for length to determine the matching lines.
(length
(filter (lambda (item) (foldl (lambda (x y) (or x y)) #f
(for/list ([x (list (point 0 0) (point 0 1) (point 1 0) (point 0 0))]