Welcome, Guest. Please Login or Register.
Apr 25th, 2024, 10:27am

Home Home Help Help Search Search Members Members Login Login Register Register
Arimaa Forum « Sample non-bitboard bot in C »


   Arimaa Forum
   Arimaa
   Bot Development
(Moderator: supersamu)
   Sample non-bitboard bot in C
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Sample non-bitboard bot in C  (Read 1461 times)
unic
Forum Guru
*****



Arimaa player #1878

   


Gender: male
Posts: 63
Sample non-bitboard bot in C
« on: May 26th, 2006, 1:21pm »
Quote Quote Modify Modify

Hello,
 
in chat the other day, I said I'd put up a simple non-bitboard bot in C... and so I have now.  It can be found at http://www.df.lth.se/~unic/fairy.zip.
 
Included in this archive are three different versions - one light (most search techniques stripped out, stupid evaluation), one medium (search almost as in full fairy, stupid evaluation), and one full (the full version of fairy).
 
People: feel free to do whatever you would like with these.  If you want to see how a basic alpha-beta with move-generation and updating the board is done, look at the light version.  If you want to see how killer-moves, etc., can be added, look at the medium version.  If you want to work on your own bot, but are only interested in working on eval, take all the code from the medium version and replace the eval with your own eval.  If you want to modify and improve fairy (or just run a clone of it), use the full version.  No strings attached, no license.  (Of course, my copy of fairy will keep evolving and changing... so the full fairy in that zip archive will soon not be the same as the full fairy I have.)
 
Note 1 - light version is limited to a fixed depth of 8 steps, which can be changed in source code.  medium and full use 2 minutes.
Note 2 - all these were developed and compiled using Dev-C++ and the MinGW distribution of gcc under Windows.  I have no clue if they compile without trouble on other compilers or OS.
 
Omar: If you want to put this (or parts of it) up on the download page, feel free to do so.
 
If anybody have questions, please feel free to ask them here.
IP Logged
Fritzlein
Forum Guru
*****



Arimaa player #706

   
Email

Gender: male
Posts: 5928
Re: Sample non-bitboard bot in C
« Reply #1 on: May 26th, 2006, 3:51pm »
Quote Quote Modify Modify

Well, that answers my question about how to convince you to enter Fairy into the Comptuer Championship.  With the code all public I only need to convince someone to port it to Linux for you.  Thanks!   Smiley
IP Logged

Swynndla
Forum Guru
*****



Arimaa player #1821

   


Posts: 235
Re: Sample non-bitboard bot in C
« Reply #2 on: May 26th, 2006, 4:17pm »
Quote Quote Modify Modify

This is very nice of you Unic ... and great for the arimaa community ... thanks!!
IP Logged
Swynndla
Forum Guru
*****



Arimaa player #1821

   


Posts: 235
Re: Sample non-bitboard bot in C
« Reply #3 on: May 26th, 2006, 4:41pm »
Quote Quote Modify Modify

And it works fine! ... in linux I compiled it via:
gcc -static -g -O4 board.c getMove.c search.c eval.c hash.c -o Fairy
 
... and it compiles just fine (this is the syntax used to compile the C Sample bot).
 
I ran it with:
./Fairy mytest.positionFile
 
(where mytest.positionFile contains a position in the forum according to the bot interface kit readme)
 
and it runs  just fine! ... gives it's running analysis and then spits out it's move!
 
I know C is portable, but I didn't realize that it'd be this easy!  Shocked
« Last Edit: May 26th, 2006, 4:42pm by Swynndla » IP Logged
aaaa
Forum Guru
*****



Arimaa player #958

   


Posts: 768
Re: Sample non-bitboard bot in C
« Reply #4 on: May 26th, 2006, 5:05pm »
Quote Quote Modify Modify

There is no -O4. -O3 is the maximum and is what everything above it gets turned into.
IP Logged
nbarriga
Forum Guru
*****



Almost retired Bot Developer

   


Gender: male
Posts: 119
Re: Sample non-bitboard bot in C
« Reply #5 on: May 27th, 2006, 7:39pm »
Quote Quote Modify Modify

I get 2 errors compiling Fairy_full:
eval.c:21: error: static declaration of ‘direction’ follows non-static declaration
board.h:168: error: previous declaration of ‘direction’ was here
 
The other 2 compile well.
IP Logged
unic
Forum Guru
*****



Arimaa player #1878

   


Gender: male
Posts: 63
Re: Sample non-bitboard bot in C
« Reply #6 on: May 27th, 2006, 7:55pm »
Quote Quote Modify Modify

Just remove that line from eval.c, and it should work - both board.c and eval.c define direction[] to be the same thing... having it defined in eval.c is a left-over.  (And as my compiler didn't spit at it, I hadn't noticed...)
IP Logged
omar
Forum Guru
*****



Arimaa player #2

   


Gender: male
Posts: 1003
Re: Sample non-bitboard bot in C
« Reply #7 on: Jun 5th, 2006, 12:21am »
Quote Quote Modify Modify

Thanks a lot for contributing this bot Ola. I have added it to the downloads page.
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.