                             :backgroundColor "rgba(0,0,0,0)"
                             }}))))
 
-(defn draw-n-square
-  [n]
-  (view {:backgroundColor "blue"
-         :style           {:flex           1
-                           :flexDirection  "row"
-                           :alignItems     "center"
-                           :justifyContent "space-around"
-                           :aspectRatio    1
-                           :margin         2
-                           }
-         :aspectRatio     1
-         }
-        (for [k (range n)]
-          (view {:key   k
-                 :style {:flex           1
-                         :flexDirection  "column"
-                         :alignItems     "center"
-                         :justifyContent "space-around"}
-                 }
-
-                (for [sq (range n)]
-                  (draw-square {:size 50}))))
-        ))
+
 
 (def testn 3)
 

                                    (text {:style {:fontSize        (* (text-field-font-size) 10)
                                                   :color           (:light-primary palette)
                                                   :backgroundColor "rgba(0,0,0,0)"
                                                   :opacity         1
                                                   }
                                           }
                                          (str nn)))))

                 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
  [scenar palette rr w h n highlight]
  (let [padding 10
        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 highlight)) a n))
                   :padding padding
                   }}
          (for [[i row] (zipmap (range) (dicen n highlight))]
            (view {:key   (str "r" i)
                   :style {:flex     0
                           :position "relative"}}
