I am learning clojure, and implementing my standard test project, Tic Tac Toe 10. I have written the same AI in many languages before and have had problems scaling it beyond 6 moves ahead in the other languages also.
I got the AI algorithm basically working, but I'm trying to improve the speed with pmap. Since everything is immutable, I should be able to just drop in pmap in place of map and get the same results, but I'm not seeing that.
(defn get-spot
[board player win-cond levels]
(def avail (get-available board))
(def final
(apply merge
(map #(array-map % (calc-score board player win-cond levels %)) avail)))
final)
But pmap in that spot returns inconsistent results. Not sure where to start looking. I can post more of the code if it's needed.