Project:
 ```1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 ``` ```; four points determine a square (define sort #f) (define merge #f) (let () (define dosort (lambda (pred? ls n) (if (= n 1) (list (car ls)) (let ((i (quotient n 2))) (domerge pred? (dosort pred? ls i) (dosort pred? (list-tail ls i) (- n i))))))) (define domerge (lambda (pred? l1 l2) (cond ((null? l1) l2) ((null? l2) l1) ((pred? (car l2) (car l1)) (cons (car l2) (domerge pred? l1 (cdr l2)))) (else (cons (car l1) (domerge pred? (cdr l1) l2)))))) (set! sort (lambda (pred? l) (if (null? l) l (dosort pred? l (length l))))) (set! merge (lambda (pred? l1 l2) (domerge pred? l1 l2)))) (define (double x) (+ x x)) (define (square x) (* x x)) (define (square? xs) (define (dist x y) (+ (square (- (car x) (car y))) (square (- (cadr x) (cadr y))))) (let ((xs (sort < (map (lambda (x) (dist (car xs) x)) (cdr xs))))) (and (= (car xs) (cadr xs)) (= (double (car xs)) (caddr xs))))) (display (square? '((0 0) (0 1) (1 1) (1 0)))) (newline) (display (square? '((0 0) (2 1) (3 -1) (1 -2)))) (newline) (display (square? '((0 0) (1 1) (0 1) (1 0)))) (newline) (display (square? '((0 0) (0 2) (3 2) (3 0)))) (newline) (display (square? '((0 0) (3 4) (8 4) (5 0)))) (newline) (display (square? '((0 0) (0 0) (1 1) (0 0)))) (newline) (display (square? '((0 0) (0 0) (1 0) (0 1)))) (newline) (display (square? '((0 0) (0 0) (0 0) (0 0)))) (newline) ```
 ```1 2 3 4 5 6 7 8 ``` ```#t #t #t #f #f #f #f #t ```