Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interprocess communication between multiple AI engines

I want to arrange an AI contest between some friends. Lets say tic tac toe, each player program a method which get the board and a symbol(X\O) and return the place which he want to play at his turn. Now my problem its how to "connect" two AI's in another program so I can test all users and see who has the best code. The only way I think of is to communicate with a text file - all the AI's have thread running on background and check changes on the text file,the engine summary the game details(which turn,the board,score,players) to the text file.

How can this can be done better? And one more little thing, this is common to have a time frame for each turn in AI contests? (Because the AI program will run in different times on different computers)

like image 494
xavi1675 Avatar asked Feb 03 '26 21:02

xavi1675


1 Answers

It isn't clear from your question whether this has to be performed online or not.

If you're after finding "the best Tic Tac Toe algorithm", you could simply:

(This may slightly differ, depending on the programming language)

  1. Define an interface (e.g: ITicTacToeSolver)
  2. Have all your friends implement it in their own way and send you a DLL with their solution.
  3. Create the game which will dynamically load these DLLs, and test them (play 1,000,000 games with the algorithm that is loaded).
  4. Keep track of game statistics to see which algorithm is best.
like image 96
lysergic-acid Avatar answered Feb 05 '26 11:02

lysergic-acid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!