Skip to content

Instantly share code, notes, and snippets.

;; jgustak's solution to Analyze a Tic-Tac-Toe Board
;; https://4clojure.com/problem/73
(fn tictac [mtx]
(let [xs (concat mtx
(vec (apply map vector mtx))
[(for [x [0 1 2]] (get-in mtx [x x]))
(for [x [0 1 2]] (get-in mtx [x (- 2 x)]))])
who (fn [ys]
(and (apply = ys) (not= (first ys) :e) (first ys)))]