Skip to content

Instantly share code, notes, and snippets.

@pelensky
Last active Aug 11, 2017
Embed
What would you like to do?
All functions required for Network Computer Player Lambda
(ns computer
(:gen-class
: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