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;
12 import ru.alphatech.icfpc.game.strategy.IStrategy;
13 import ru.alphatech.icfpc.game.strategy.SimplyStrategy;
17 private static boolean automodeapply = false;
19 private static boolean endgame = false;
21 private static Player proponent = new Player();
23 private static Player opponent = new Player();
25 private static int registers[] = new int[4];
34 private static IStrategy strategy = new SimplyStrategy();
36 public static Slot getRegisterByIndex(int registerIdex){
37 return proponent.getSlot( registers[registerIdex] );
40 public static Player getOpponent(){
44 public static Player getProponent(){
48 private static void readOpponent() throws IOException
50 BufferedReader breader = new BufferedReader(new InputStreamReader(System.in));
51 String turnCase = breader.readLine();
55 if("1".equals(turnCase))
57 card = breader.readLine();
58 slot = breader.readLine();
60 else if("2".equals(turnCase))
62 slot = breader.readLine();
63 card = breader.readLine();
70 if(turnCase == null || card == null || slot == null)
79 private static void writeMove()
81 Batch batch = strategy.move(proponent, opponent);
82 System.out.print(batch);
83 proponent.applyBatch(batch);
86 public static boolean getAutoMode()
91 public static void main(String[] args) throws IOException
93 String playerNum = args[0];
95 if("1".equals(playerNum))