Sure, the source code can be found here (NOTE: this file may or may not be updated to the latest version):
http://users.conquer-space.net/~ulf/aichess4k/aichess4k.java
I would be interested to hear any easy, yet significant optimizations (please don’t waste time with changing | to || or something like that). I will have a look at the 4KJO tool.
My current approach at packing this into a jar is as follows:
- compile with javac from sun 1.5.0_10
- jar
- optimize with proguard (http://proguard.sourceforge.net/)
- unzip and rezip with kzip (http://advsys.net/ken/utils.htm)
Looking at the source, I feel like it could do with a couple more comments. I’m happy to answer questions about the source and algorithms, here or in irc (#lwjgl on freenode).
PS: I’m on linux here, so I can’t use the 4KJO tool directly.
PPS:
-
no repaint while ai is working
Disregarding any potential race conditions, I can do this in about 4 bytes.
-
doesn’t show that ai is working
This is damn expensive, at about 83 65 45 bytes.
-
the ai is too difficult
Weighting in at 3 byte. It’s so damn stupid at the first level, I have to make the second level the default level.
PPPS:
And another go at ai settings. Now it’s actually saving space, and IMHO, it’s easier to beat at the easy level. And even the third level is actually playable in terms of performance.
New version is up, new source is up, and it’s still below 4096. Testing and feedback is welcome.