 (ns wordup.logic.board
-  (:require [clojure.set :as set])
-  (:use [clojure.tools.logging :only (spy)]))
+  (:require [clojure.set :as set]
+            [clojure.tools.logging :as log]))
 
 (def letters-list (map char (concat (range 65 91))))
+
+(def letters-weighed (zipmap letters-list
+                        [9 2 2 4 12 2 3 2 9 1 1 4 2 6 8 2 1 6 4 6 4 2 2 1 2 1]))
+
+(def weighed-letters-list
+  (->> letters-weighed
+    (map #(repeat (val %) (key %)))
+    flatten))
+
+(defn random-weighed-letter
+  []
+  (rand-nth weighed-letters-list))
 
 (defn random-letter
   []


(defn random-board
  [x y]
  (-> []
    (into (repeatedly y #(random-row x)))))

(defn str-board
  [board]

  [board words]
  (sort #(> (count %1) (count %2)) (filter #(contains-word? board %) @words)))

(defn log-board!
  [board]
  (log/info (str "\n" (str-board board))))

; (ns wordup.logic.board)
; (use 'wordup.logic.dict)
