Blame


1 12687dd9 2023-08-04 jrmu ;; The first three lines of this file were inserted by DrScheme. They record metadata
2 12687dd9 2023-08-04 jrmu ;; about the language level of this file in a form that our tools can easily process.
3 12687dd9 2023-08-04 jrmu #reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname |28.2|) (read-case-sensitive #t) (teachpacks ((lib "draw.ss" "teachpack" "htdp") (lib "arrow.ss" "teachpack" "htdp") (lib "gui.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "draw.ss" "teachpack" "htdp") (lib "arrow.ss" "teachpack" "htdp") (lib "gui.ss" "teachpack" "htdp")))))
4 12687dd9 2023-08-04 jrmu (define (create-posn-list rows cols)
5 12687dd9 2023-08-04 jrmu (cond
6 12687dd9 2023-08-04 jrmu [(= rows 0) empty]
7 12687dd9 2023-08-04 jrmu [(> rows 0) (append (create-posn-list (sub1 rows) cols)
8 12687dd9 2023-08-04 jrmu (build-list cols (lambda (c) (make-posn rows (+ c 1)))))]))
9 12687dd9 2023-08-04 jrmu
10 12687dd9 2023-08-04 jrmu
11 12687dd9 2023-08-04 jrmu (cond
12 12687dd9 2023-08-04 jrmu [(or (zero? rows)
13 12687dd9 2023-08-04 jrmu (zero? cols)) empty]
14 12687dd9 2023-08-04 jrmu [else (append (build- (sub1 rows) cols f)
15 12687dd9 2023-08-04 jrmu (list (build-list cols (lambda (x) (make-posn rows (+ x 1))))))]))
16 12687dd9 2023-08-04 jrmu