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)))))