Halite Home

Clojure starter package?


#1

Anyone already working on a Clojure starter package - or have reason to believe it wouldn't work?
I'd be interested to contribute it myself, otherwise.


#2

I am interested, but to lazy to make one myself :slight_smile:


#3

@adereth has sent a PR.


#4

Oh, brilliant - saves me a good bit of work. :slight_smile: Clojurians, keep an eye on https://github.com/HaliteChallenge/Halite/pull/166. Thanks @adareth.


#5

Yea, the code looks good at a first look. But I struggle getting it running.
For now its missing an example runGame, but thats just for completeness.
Also I am not sure if it works with the namespace. I copied the source files directly to the source folder, removed the namespaces and used what is shown in the compiler.py file: https://github.com/HaliteChallenge/Halite/blob/c56bb0621b4794ccea5272d28533dc3ad898eaf5/worker/compiler.py#L311

Unluckily, when starting it with halite it just times out with:
--- Init ---

ERRORED!
No response received.

This is how I start it:
halite -d "25 25" "java -cp ../clojure-1.8.0.jar:. clojure.main MyBot.clj" "java -cp ../clojure-1.8.0.jar:. clojure.main MyBot.clj"

Also I renamed the bot.clj to MyBot.clj, as this is what the compiler is looking for.

Any ideas? Did someone get a clojure version working?


#6

i put my private version online, i was gonna clean it up a bit before publishing but it might be useful

to run just do something like

$ lein uberjar
$ ./halite -d "30 30" "java -jar $PATH/TO/CODE/target/uberjar/halite-0.1.0-SNAPSHOT-standalone.jar" "java RandomBot"


#7

@yawnt why not start it with "lein run" instead of compiling an uberjar before?


#8

because there's an open issue (https://github.com/HaliteChallenge/Halite/issues/215) that should result in adding support for JARs. I'm assuming that will land earlier than lein support :slight_smile:

(plus lein has overhead, etc etc ..)


#9

JARs are now supported. Just include your MyBot.jar in your zip submission, and it will be run with java -jar MyBot.jar.


#10

If I want to test my bot locally, can I still use the "old" halite and just replace the java call by "java -jar MyBot.jar" for my own bots?

EDIT: I just tried it and it just works, very nice :slight_smile:


#11

Full Clojure support with lein is now up!