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 48 49 50 51 52 53 ``` ```; triangle trilemma (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 (tri x y z) (define (square x) (* x x)) (define (norm x y) (+ (square (- (car x) (car y))) (square (- (cadr x) (cadr y))))) (let* ((sq-sides (sort < (list (norm x y) (norm y z) (norm x z)))) (a (car sq-sides)) (b (cadr sq-sides)) (c (caddr sq-sides))) (cond ((zero? (- (* a c) (square (/ (+ a c (- b)) 2)))) "not a triangle") ((= a b c) "equilateral triangle") (else (string-append (if (or (= a b) (= b c)) "isoceles" "scalene") (cond ((and (< c (+ a b)) (< a (+ b c)) (< b (+ a c))) " acute triangle") ((or (< (+ a b) c) (< (+ b c) a) (< (+ a c) b)) " obtuse triangle") (else " right triangle"))))))) (display (tri '(0 1) '(0 2) '(0 3))) (newline) (display (tri '(0 0) '(1 5) '(2 0))) (newline) (display (tri '(0 0) '(10 5) '(20 0))) (newline) (display (tri '(0 0) '(0 5) '(5 0))) (newline) (display (tri '(0 0) '(10 5) '(20 1))) (newline) (display (tri '(0 0) '(0 3) '(4 0))) (newline) (display (tri '(0 0) '(2 4) '(4 1))) (newline) ```
 ```1 2 3 4 5 6 7 ``` ```not a triangle isoceles acute triangle isoceles obtuse triangle isoceles right triangle scalene obtuse triangle scalene right triangle scalene acute triangle ```