Code: Select all
-rwxr-xr-x shell shell 18940 2012-07-07 13:05 iota
Moderator: Ras
Code: Select all
-rwxr-xr-x shell shell 18940 2012-07-07 13:05 iota
Size of 30kb was for GCC. TCC was 3.50 kbMincho Georgiev wrote:Sorry, I didn't saw that you already use tcc. Otherwise I would be surprised by the 30k size /obiously the size optimization fixed this/. tcc and pelle's where the compilers that I was able to produce smallest win executables with. The only compilers for smaller windows executable that I have been used are masm and nasm, irrelevant in this case though.
You have my permission, although be warned that it plays extremely weak on a desktop computer, never mind a mobile... Hopefully later versions can change this.abik wrote:Nice! I compiled this for ARM-based Android devices, and the result is about 18KB. With your explicit permission, I can post the binary on UCI and XBoard engines for Android.
Code: Select all
-rwxr-xr-x shell shell 18940 2012-07-07 13:05 iota
Thanks!Daniel White wrote:You have my permission, although be warned that it plays extremely weak on a desktop computer, never mind a mobile... Hopefully later versions can change this.
Code: Select all
printf("bestmove %c%i%c%i%c\n", t%16+97, t/16+1, u%16+97, u/16+1,
((B[t]%8==2 && (u/16==0 || u/16==7)) ? 'q' : 0)); }
Code: Select all
printf("bestmove %c%i%c%i%c\n", t%16+97, t/16+1, u%16+97, u/16+1,
((B[t]%8==2 && (u/16==0 || u/16==7)) ? 'q' : ' ')); }
Ah yes I hadn't considered that. Although we can use 32 instead of ' ' to add only a single character. I'm sure that line can be improved anyway.abik wrote:Thanks!Daniel White wrote:You have my permission, although be warned that it plays extremely weak on a desktop computer, never mind a mobile... Hopefully later versions can change this.
May I suggest changing
into (sorry for the two extra characters), to avoid potential GUI confusion on the null character?Code: Select all
printf("bestmove %c%i%c%i%c\n", t%16+97, t/16+1, u%16+97, u/16+1, ((B[t]%8==2 && (u/16==0 || u/16==7)) ? 'q' : 0)); }Code: Select all
printf("bestmove %c%i%c%i%c\n", t%16+97, t/16+1, u%16+97, u/16+1, ((B[t]%8==2 && (u/16==0 || u/16==7)) ? 'q' : ' ')); }
Code: Select all
(B[t]%8==2 & (u+u-t+1&128) ? 'q' : 32)); }
I think those errors could be fixed by adding '#include <string.h>' at the top (although this obviously adds a lot of characters which are unneeded in GCC).Jim Ablett wrote:Hi Mincho,Mincho Georgiev wrote:Try this, Jim:Jim Ablett wrote:Edmund wrote:I thought Tiny C was just notable for the small size of the compiler, not the size of its compiles. Couldn't you get better results with intel compiler optimizing for size?Jim Ablett wrote:Hi Daniel,
Very well done. It's quite remarkable you can get working engine in such a small amount of code.
I compiled a very small windows executable using Tiny C + Upx compression and got the binary size down to an incredible 3.50 kb.
I named it 'Iota' to avoid confusion with other engine.
https://dl.dropbox.com/u/5047625/iota-10-32-tcc-ja.zip
Jim.
Smallest size I can get with GCC (inc compression) is 26.5kb
Smallest size I can get with Intel (inc compression) is 30.0kb
Ok my challenge is for someone to produce a windows exe smaller than 3.50 kb
Jim.
http://bellard.org/tcc/
or
http://www.smorgasbordet.com/pellesc/
Tcc is what I used.
Pelles C throws up a few errors and won't compile.
Jim.Code: Select all
C:\temp\iota.c(57): warning #2099: Missing type specifier; assuming 'int'. C:\temp\iota.c(60): warning #2027: Missing prototype for 'strtok'. C:\temp\iota.c(60): warning #2241: The function 'gets' is marked as deprecated. C:\temp\iota.c(61): warning #2027: Missing prototype for 'strncmp'. C:\temp\iota.c(62): warning #2027: Missing prototype for 'strncmp'. C:\temp\iota.c(63): warning #2027: Missing prototype for 'strncmp'. C:\temp\iota.c(64): warning #2027: Missing prototype for 'strncmp'. C:\temp\iota.c(71): error #2168: Operands of '=' have incompatible types 'char *' and 'int'. C:\temp\iota.c(71): warning #2030: '=' used in a conditional expression. C:\temp\iota.c(72): warning #2027: Missing prototype for 'strncmp'. C:\temp\iota.c(73): error #2168: Operands of '=' have incompatible types 'char *' and 'int'. C:\temp\iota.c(73): warning #2030: '=' used in a conditional expression. C:\temp\iota.c(74): warning #2027: Missing prototype for 'strcmp'. C:\temp\iota.c(74): error #2140: Type error in argument 1 to '__stoul'; expected 'const char *' but found 'int'.
Quick tournament in Chess for Android against similar engines. Since Iota takes about 10 seconds per move on my Nexus One, I gave the other engines the same amount of time per move. Played with 10 random openings from built-in book.Daniel White wrote:You have my permission, although be warned that it plays extremely weak on a desktop computer, never mind a mobile... Hopefully later versions can change this.
Code: Select all
Iota - Chess for Android 0.0 - 10.0 +0/-10/=0 0.00%
Iota - umax48w 0.5 - 9.5 +0/-9/=1 5.00%
Iota - DeepBrutePos v1.6 9.5 - 0.5 +9/-0/=1 95.00%
You could also use 9, which is a TAB character. The UCI specification says this is allowed.Daniel White wrote:Ah yes I hadn't considered that. Although we can use 32 instead of ' ' to add only a single character. I'm sure that line can be improved anyway.abik wrote:May I suggest changing
into (sorry for the two extra characters), to avoid potential GUI confusion on the null character?Code: Select all
printf("bestmove %c%i%c%i%c\n", t%16+97, t/16+1, u%16+97, u/16+1, ((B[t]%8==2 && (u/16==0 || u/16==7)) ? 'q' : 0)); }Code: Select all
printf("bestmove %c%i%c%i%c\n", t%16+97, t/16+1, u%16+97, u/16+1, ((B[t]%8==2 && (u/16==0 || u/16==7)) ? 'q' : ' ')); }
Edit: This should do it:Code: Select all
(B[t]%8==2 & (u+u-t+1&128) ? 'q' : 32)); }
Woo it actually won a gameabik wrote:Quick tournament in Chess for Android against similar engines. Since Iota takes about 10 seconds per move on my Nexus One, I gave the other engines the same amount of time per move. Played with 10 random openings from built-in book.Daniel White wrote:You have my permission, although be warned that it plays extremely weak on a desktop computer, never mind a mobile... Hopefully later versions can change this.
The Iota binary for ARM-based Android devices can be found at UCI and XBoard engines for Android.
Code: Select all
Iota - Chess for Android 0.0 - 10.0 +0/-10/=0 0.00% Iota - umax48w 0.5 - 9.5 +0/-9/=1 5.00% Iota - DeepBrutePos v1.6 9.5 - 0.5 +9/-0/=1 95.00%
Code: Select all
if (!strcmp(i+1, "time") & *i==(M&64?119:98)) l=atoi(X)<<9;
Hi Daniel, and congrats for this beautiful achievement!Daniel White wrote: Iota is fine by me! I'll update the original post now... (edit: turns out I'm not allowed to do so)