sort list of points

Started by cameyo, May 28, 2021, 11:33:23 AM

Previous topic - Next topic

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.

cameyo

#1
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