lrm-hitfn

December 6, 2009
by Lee Morgan (lrm07)

(define lrm1-hitfn
  (lambda (mine others)
    (letrec ((lrm-plus
              (lambda (l)
                (cond ((null? l)
                       0)
                      ((not (pair? (car l)))
                       (+ (car l) (lrm-plus (cdr l))))
                      (else (+ (lrm-plus (car l))
                               (lrm-plus (cdr l))))))))
      (cond ((and (> (apply + mine) 7)
                  (< (apply + mine) 12)
                  (member '1 mine))
             #f)
            ((> (apply + mine) 16)
             #f)
            ((and (> (apply + mine) 14)
                  (< (/ (lrm-plus others)
                        (length others)) 5.5))
             #f)
            (else #t)))))

If anyone else has a problem with using greater than and less than signs on the blog, use (without quotes and spaces) “& g t ;” and “& l t ;”



Leave a Reply

You must be logged in to post a comment.