                     (first))]
     (if (= nil result) 0 result)))
 
-
-
-
-
-
 (defn two-pair [dice]
   (let [tallies (tally-die dice)
         result (->> (range 0 6)


(defn chance [d1 d2 d3 d4 d5]
  (+ d1 d2 d3 d4 d5))

(defn ones [d1 d2 d3 d4 d5]
  (+ (if (= d1 1) 1 0)

                    (* 2))]
    (if (= nil result) 0 result)))

;public static int yatzy(int... dice)
;{
; int[] counts = new int[6];
;    for (int die : dice)
;    counts[die-1]++;
; for (int i = 0; i != 6; i++)
;    if (counts[i] == 5)
;        return 50;
; return 0;
; }



(defn get-first-tally [tallies value]
  (->> (range 0 6)
       (filter #(= value (nth tallies %)))
       (first)))

(defn four-of-a-kind [dice]
  (let [tallies (tally-die dice)
        result (first
                 (remove nil?
                         (for [i (range 0 6)]
                           (if (>= (nth tallies i) 4)
                             (* (+ i 1) 4)
                             nil
                             )
                           )
                         ))]
    (if (= nil result)
      0 result
      )
    )
  )

(defn three-of-a-kind [dice]
  (let [t (tally-die dice)
        result (first
                 (remove nil?
                         (for [i (range 0 6)]
                           (if (>= (nth t i) 3)
                             (* (+ i 1) 3)
                             nil
                             )
                           )
                         ))]
    (if (= nil result)
      0 result
      )
    )
  )


(defn small-straight [dice]
