Help for this page

Select Code to Download


  1. or download this
    (let ((g (* 2 (or (gethash word good) 0)))
         (b (or (gethash word bad) 0))) 
           (unless (< (+ g b) 5) 
    ...
          (+ prod 
          (apply #'* 
            (mapcar #'(lambda (x) (- 1 x)) probs)))))
    
  2. or download this
    use List::Util qw(min max reduce);
    sub score {
    ...
        my $prod = reduce { $a * $b } @probs;
        return $prod / ($prod + reduce { $a * $b } map { 1 - $_ } @probs);
    }