This year's challenge was to write a Tron bot. One of the things that made it very attractive was the large choice of programming languages that could be used for implementation. Aerique produced the Common Lisp starter package, running on SBCL. A Scheme package was also available, but I didn't see too many takers.
My not-too-lispy code is on github at google-ai-tronbot. It is just a basic minimax, so nothing revolutionary.
I did get some experience out of this, other than actually writing some Lisp code.
- if I take out the cruft (unused code and the-same-as-everyone interface code), my program would be ~200 LOC long
- there's a time limit of 1 second for every move; I can consistently produce a move within 1-2 msec of my time target, without undue interference from the garbage collector/runtime
- it is FAST, to the point where I get the same game tree depth as equivalent C implementations
- trust your compiler: given the algorithm complexity, a 20-30% increase in performance doesn't mean much, so better spend that time making the code correct rather than fast. Besides, SBCL did a great job.
All in all, it was great fun and I learned quite a bit. It was also nice to see some interest in Common Lisp - 12 contestants, of which Gábor Melis has a good chance of finishing in the top 10, among the C/C++ furries ;-)
In other news, I just received my copy of Christian Queinnec's Lisp in Small Pieces.
Yalfs is back.
EDIT: made it #32.
> In other news, I just received my copy of Christian Queinnec's Lisp in Small Pieces.
RăspundețiȘtergereI finished reading through to the end of chapter 7 a couple weeks ago. What a great book!
Indeed it is. I had a pdf stashed somewhere, but somehow I never fully read them until I get the real thing :-)
RăspundețiȘtergere