ちょっとコードを書き換えました。最も大きな変更点は、LeiningenからClojure CLIへの移行です。REPLを開始するには、以下のようにしてください。
$ clj -M:dev
nREPL server started on port 5876 on host pagead2.googlesyndication.com - nrepl://pagead2.googlesyndication.com:5876
nREPL 1.3.1
Clojure 1.10.3
OpenJDK 64-Bit Server VM 19+36-2238
Interrupt: Control+C
Exit: Control+D or (exit) or (quit)
user=> (dev)
#object[clojure.lang.Namespace 0x641abf8 "othe.core"]
othe.core=>
uberjarをビルドするときは、↓これです。
$ clojure -T:build uber
$ ls target
classes/ othe.jar
makeコマンドが使える環境のために、Makefileも用意しました。
$ make dev
$ make run
$ make uber
その他の変更点は以下の通りです。
nsフォームの中で、:useの代わりに:requireを使うdefの代わりに、alter-var-rootを使う
書籍と同じコードが見たい場合は、bookブランチを使ってください。
$ git checkout book
以下、オリジナルREADME
Othe is a board game, similar to Othello or Reversi, written in Clojure.
lein run
Copyright © 2013 gpsoft
Distributed under the Eclipse Public License, the same as Clojure.
オセロに似たゲームをClojureで書いてみました。Clojureも関数型プログラミングも、これが初挑戦でした。このプログラムを教材として使った電子書籍「Clojureで、初めての関数型プログラミング」をアマゾンで販売中です。