Ultimate Tic Tac Toe - Not getting back all valid actions

I’m in the bronze league for Ultimate Tic Tac Toe. In bronze league we have 9 tic tac toe boards. I’m finding that on most turns the list of valid actions contains just a single board. The first turn (if I’m going first) I’ll see 81 valid moves. Then most turns after that I get back just a single board of valid moves (9 moves or less). Occasionally I’ll get back everything (53 moves for example).

I assumed that there was something wrong with my reading from standard in since no one has complained about this yet, but the reading for this game is really simple.

Here’s a full program in Clojure to reproduce (and it shows that all of the moves returned match a single board instead of moves from all 9 boards, so it does seem like the game is intentionally sending back just a single board).

(ns Player
  (:gen-class))

(defn -main
  "Main"
  [& args]
  (while true
    (let [opponent-row (read)
          opponent-col (read)
          num-valid-moves (read)
          potential-moves (doall (for [n (range num-valid-moves)
                                       :let [row (read)
                                             col (read)]]
                                   {:row row :col col}))
          the-move (first potential-moves)]
      (binding [*out* *err*]
        (println "Opponent row" opponent-row)
        (println "Opponent column" opponent-col)
        (println "Num valid moves:" num-valid-moves)
        (println "Open spots" potential-moves)
        (println "Count of open spots" (count potential-moves)))

      ;; Write action to stdout
      (println (:row the-move) (:col the-move)))))

The rules say:

When a player plays on a small board, he also decides where the next player will be allowed to play: for example, if a player has played in the bottom left square of one of the small boards, the next player will play on the small board located at the bottom left square of the main board.

If a player is sent to a board that is either already won, or full, then that player is allowed to play in any empty square.

Thanks for the really fast response. RTFM :slight_smile: