From e4cd2808c2f3994d7e1286651dbf636bc62c90f3 Mon Sep 17 00:00:00 2001 From: nihilazo Date: Fri, 1 Apr 2022 23:14:22 +0100 Subject: [PATCH] finish comments --- main.rkt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.rkt b/main.rkt index c89fe0b..544e66c 100644 --- a/main.rkt +++ b/main.rkt @@ -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))]