                  3 0)
                :else 0)))
 
+(defn ffloyd-sample
+  "Pick n random different integers from 0..nn"
+  [nn n]
+  (let [count (inc nn)]
+    (loop [i (- count n)
+           res #{}]
+      (if (< i count)
+        (let [j (inc i)
+              k (rand-int j)]
+          (if (res k)
+            (recur j (conj res i))
+            (recur j (conj res k))))
+        res))))
+(comment
+  (ffloyd-sample 10 3)
+  ; => #{7 1 8} for example
+  (ffloyd-sample 10 9)
+  ; => #{0 1 2 5 6 7 8 9 10} for example
+  )
+
+(rum/defc draw-icon
+  [{:keys [scenar size draw? key color back]
+    :or   {size 100 draw? true key nil color "white" back "black"}}]
+  "draw a icon selected by scenario."
+  (view {:key   key
+         :style {:backgroundColor back
+                 :paddingTop      1
+                 :aspectRatio     1
+                 :opacity         (if draw? 1 0)
+                 :flexDirection   "column"
+                 :justifyContent  "center"
+                 :alignItems      "center"
+                 :width           size                      ;size
+                 :borderRadius    (/ size 2)
+                 }}
+        (view
+          {:style {:transform (clj->js [{:scale (/ size 100)}])}}
+          (ionicon {:name  (:icon scenar)                   ;"ios-radio-button-on"
+                    :size  100
+                    :style {:width           100
+                            :textAlign       "center"
+                            :color           color
+                            :backgroundColor "rgba(0,0,0,0)"
+                            }})))
+  )
+
+
 (rum/defc nested-n-square** < rum/static
-  [w h n]
+  [scenar palette rr w h n highlight]
   (let [padding 10
-        cols (count ((dicen n) 0))
-        rows (count (dicen n))
-        a (/ (- w (* 2 padding)) cols)]
+        cols (count ((dicen n highlight) 0))
+        rows (count (dicen n highlight))
+        a (/ (- w (* 2 padding)) cols)
+        ]
+    (prn highlight)
     (view {:style {:flex    0
                    :width   w
-                   :height  (+ (* 2 padding) (icon-top (count (dicen n)) a n))
+                   :height  (+ (* 2 padding) (icon-top (count (dicen n highlight)) a n))
                    :padding padding
-
                    }}
-          (for [[i row] (zipmap (range) (dicen n))]
+          (for [[i row] (zipmap (range) (dicen n highlight))]
             (view {:key   (str "r" i)
                    :style {:flex     0
                            :position "relative"}}

                                 :left     0
                                 :right    0
                                 :zIndex   1
                                 :height   1000}}
                        (scroll-view {:onScroll            handle-scroll
                                      :scrollEventThrottle 16
                                      :key                 1
                                      :style               {:flex          1
                                                            :flexDirection "column"
                                                            :opacity 0.8}}

                                     (nested-n-square** w h nn)))

                  (view {:key   2
                         :style {:position "absolute"

    (map flatten)
    (mapv vec)))

(defn blocks
  [n cols w h]
  (->>
    (range (* cols (Math.ceil (/ n cols))))
    (map-indexed #(if (< %1 n) 1 0))
    (partition-all cols)
