Last active
August 11, 2017 10:20
-
-
Save pelensky/c8f05423fc8d7152b96e90991ebeff3a to your computer and use it in GitHub Desktop.
All functions required for Network Computer Player Lambda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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