Inductive Reasoning



Jonathan Roelofs 


Virus Game

Virus Game was my implementation of one of the generation5.org projects designed to provoke intellectual thoughts about programming atrificial agents to play games.

I started this project in the Fall of 2004 in one of my high school cs classes with the intent that some of my classmates would also write AI agents for this framework, and we could have some sort of tournament. Unfortunately AI was a bit too intimidating for them, and no-one else was willing to try to make agents for the competition.

Running It

If you wish to see the applet in action, click here.

Making Your Own Players

All of the classes that extend the abstract VirusPlayer class can become players for this game. To make it work you have to compile your player (Ex. whitePlayer, blackPlayer), then change these lines in VirusApplet.java:

    public void init() {
        VirusPlayer white = new testVP(WHITE);
        VirusPlayer black = new testVP2(BLACK);
        myVG = new VirusGame(white, black);

to something like this:

    public void init() {
        VirusPlayer white = new whitePlayer(WHITE);
        VirusPlayer black = new blackPlayer(BLACK);
        myVG = new VirusGame(white, black);

and compile all the sources, then run Applet.html to see the results.

There are a few good websites to help you get started with writing AI agents, the first of which is of course the virus game project page on the generation5.org website. Another useful resource was the paper "Using Bugs and Viruses to Teach Artificial Intelligence", another from generation5.

Description of VirusApplet

This java applet based GUI for VirusGame should be fairly straitforward.

On the top left is each player (white or black) and the number of pieces that they own. Just below that is what step we are on, and whos turn it was on the last step. The cyan square is white's most recent move. The Magenta one is black's most recent move.

Click on "Step" to have the next player take its turn.
Click on "15 Steps" to have "Step" clicked 15 times.
Click on "End" to see what the end result will be.
Click on "Reset" to reset the board.

Conclusion

This was a very long, but not so diffucult project; It took me around two weeks to program. I worked on it for around one or two hours each day in my independent-study AP Computer Science AB class and about an hour at home.

One more thing... please tell me about any improvements or AI players that you make for this framework. I always love hearing about other people's interesting (and even non-interesting) uses for my projects.


Download (src,bin)
Copyright © Jon Roelofs November 29th, 2004