SHARE
TWEET

Untitled

a guest Dec 12th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (define (finishShow startTime minutes)
  2.   (exactTime (list (car startTime) (+ (cadr startTime) minutes))))
  3.  
  4. (define (exactTime listOfTime)
  5.   (if (>= (cadr listOfTime) 60) (exactTime (list (+ (car listOfTime) 1) (- (cadr listOfTime) 60)))
  6.                                 listOfTime))
  7.  
  8. (define (laterThan s1 s2)
  9.   (let* ((timeS1 (finishShow (cadr s1) (caddr s1)))
  10.          (timeS2 (finishShow (cadr s2)  (caddr s2)))
  11.          (hourS1 (car timeS1))
  12.          (hourS2 (car timeS2))
  13.          (minutesS1 (cadr timeS1))
  14.          (minutesS2 (cadr timeS2)))                
  15.   (cond ((> hourS1 hourS2) s1)
  16.         ((< hourS1 hourS2) s2)
  17.         ((> minutesS1 minutesS2) s1)
  18.         (else s2))))
  19.  
  20. (define (maxOfShows l)
  21.   (if (null? l) '("" (0 0) 0)
  22.   (laterThan (car l) (maxOfShows (cdr l)))))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top