ensure that the start of next cut is after end of current cut

This commit is contained in:
Leo Butler 2020-10-23 13:25:12 -05:00
parent 832580ea6a
commit e5270ae588
1 changed files with 2 additions and 2 deletions

View File

@ -182,10 +182,10 @@
(define (cl l acc)
(if (null? l) (reverse acc)
(cond ((end-of-cut? (cdar l))
(cl (cddr l) (append (list (cons (caar l) (caadr l))) acc)))
(cl (cddr l) (if (< (caar l) (caadr l)) (append (list (cons (caar l) (caadr l))) acc) acc)))
(cl (cdr l) acc)))))
(if (start-of-cut? (cadar s))
(if (and (start-of-cut? (cadar s)) (> (caar s) 0))
(set! s (append '((0 0)) s)))
(if (end-of-cut? (cadr (last s)))
(set! s (append s (list (list (if (null? f) (greatest-fixnum) (caar f)) 1)))))