I've programmed an AI to play the game "4-in-a-row", I've made use of the C language. Then I've begun to look at some Java tutorial because I wanted to build a graphic interface (better than an ASCII graphic!).
But I don't know how to integrate my c function in the java applet.
The real problem is in C language, so I 'm not really sure this forum is the right place for writing this thread.
At this moment my C program is stand-alone, so it performs a dept-first search every turn to find the best move. Now I want to integrate this program in a Java applet, so it must become a function which returns the best move for a certain configuration of the board. But now all my local C variables (List, Tree...) are lost everytime I exit from the C function, because now the programs must run in two enviroment (C and Java). So here come the question: how can I do to make the variables global for the two languages?
If someone is so clever to understand my primordial english and he has an idea to solve this problem, I'll appreciated it.