auto application state.
1 /***********************************************
3 * بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِِ
4 * Time: 18.06.2011 11:37:46
5 ***********************************************/
6 package ru.alphatech.icfpc.game;
8 import java.io.BufferedReader;
9 import java.io.IOException;
10 import java.io.InputStreamReader;
11 import java.util.LinkedList;
12 import java.util.List;
14 import ru.alphatech.icfpc.game.strategy.IStrategy;
15 import ru.alphatech.icfpc.game.strategy.SimplyStrategy;
19 private static boolean automodeapply = false;
21 private static boolean endgame = false;
23 private static Player proponent = new Player();
25 private static Player opponent = new Player();
27 private static LinkedList<Batch> batches = new LinkedList<Batch>();
29 private static int registers[] = new int[4];
38 private static IStrategy strategy = new SimplyStrategy();
40 public static Slot getRegisterByIndex(int registerIdex){
41 return proponent.getSlot( registers[registerIdex] );
44 public static void clearBatcher(){
45 batches.removeAll(batches);
48 public static void addBatcher(List<Batch> batches){
49 batches.addAll(batches);
52 public static Player getOpponent(){
56 public static Player getProponent(){
60 private static void readOpponent() throws IOException
62 BufferedReader breader = new BufferedReader(new InputStreamReader(System.in));
63 String turnCase = breader.readLine();
67 if("1".equals(turnCase))
69 card = breader.readLine();
70 slot = breader.readLine();
72 else if("2".equals(turnCase))
74 slot = breader.readLine();
75 card = breader.readLine();
82 if(turnCase == null || card == null || slot == null)
88 private static void writeMove()
90 strategy.moving(proponent, opponent, System.out);
93 public static boolean getAutoMode()
98 public static void main(String[] args) throws IOException
100 String playerNum = args[0];
102 if("1".equals(playerNum))