KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > innig > macker > example > modularity > Main


1 package net.innig.macker.example.modularity;
2
3 import net.innig.macker.example.modularity.game.*;
4 import net.innig.macker.example.modularity.player.*;
5 import java.util.*;
6
7 public class Main
8     {
9     public static void main(String JavaDoc[] args)
10         {
11         Game g = GameFactory.createGame(args[0]);
12         g.setPlayer(0, PlayerFactory.createPlayer(args[1]));
13         g.setPlayer(1, PlayerFactory.createPlayer(args[2]));
14         
15         while(true)
16             {
17             System.out.println(
18                 g.getPreviousMove(0) + " / " + g.getPreviousMove(1)
19                 + " (score: " + g.getScore(0) + " to " + g.getScore(1) + ")");
20             g.move();
21             }
22         }
23     }
24
Popular Tags