                   }))
   (.start (.-state game) "main"))
 
-(defn ^export restart []
-  (reset! *border* rcore/*default-border*)
-  (reset! *phaser-border* [[] [] [] [] [] [] [] []])
-  (reset! *visible-possible-grids-pos* '())
-  (start))
-
-(start)
+(start *game*)

        style (clj->js { :font "35px Arial" :fill "#000000" :align "left" })]
    (set! (.-pieceCountText game) (.text (.-add game) 615 20 text style))))

(defn create-buttons [game]
  (let [restart-button
        (.sprite (.-add game) 675 515 "restart-button")]
    (set! (.-inputEnabled restart-button) true)
    (set! (.-useHandCursor (.-input restart-button)) true)
    (.add (.-onInputDown (.-events restart-button))
          (fn [b] (restart)) game)))

(defn create [game]
  (set! (.-backgroundColor (.-stage game)) "#ffffff")

             @*phaser-border*)
  (pc-ai-put-piece @*border* @*phaser-border*)
  (let [no-put-piece-ai-and-player?
        (nil? (show-possible-grid-on-pborder @*border* @*phaser-border*))]
    (when (or (rcore/end-game? @*border*) no-put-piece-ai-and-player?)
      (let [winner (rcore/who-win? @*border*)]
        (if (= winner *default-player-use-piece*)
          (js/alert "you are winner!")
          (js/alert "you are loser!")))))
  (let [result-count (rcore/grid-count @*border*)]
    (set! (.-text (.-pieceCountText *game*))
          (str "black-piece: " (result-count rcore/*black-piece*)
               "\nwhite-piece: " (result-count rcore/*white-piece*)
               ))))

(defn create-pieces [piece-name game]
  (let [piece-color (grid-name->rcore-grid piece-name)]
