Skip to content

Instantly share code, notes, and snippets.

Last active Aug 11, 2017
What would you like to do?
All functions required for Network Computer Player Lambda
(ns computer
:methods [[handler [networkplayer.BoardObject] Long]]) )
(declare negamax)
(def starting-depth 0)
(def starting-colour 1)
; Code removed
(defn choose-space [board-state]
(let [board (get-board board-state)]
(if (> 2 (count board))
(if (.contains board 4) 0 4)
(negamax board-state starting-depth starting-colour (find-computer-marker board-state)))))
(defn -handler [this board-object]
(let [board-state (read-string (.getBoardState board-object))]
(choose-space board-state)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment