Page 1 of 1

sort list of points

Posted: Fri May 28, 2021 6:33 pm
by cameyo
How to sort a list of points (x y) with x ascending and y descending?
I have tried this, but don't work:
(define (comp x y) (and (>= (last x) (last y)) (<= (first x) (first y))))
I can't post all the code... Internal Server Error.

Re: sort list of points

Posted: Fri May 28, 2021 7:41 pm
by cameyo
Solution found.
(define (cmp x y) (if (= (first x) (first y)) (g.t. (last x) (last y)) (l.t. (first x) (first y))))

Fortran operator g.t. and l.t. don't raise Internal Server Error