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 registerIndex){
37 return proponent.getSlot( registers[registerIndex] );
40 public static int getRegisterSlotNum(int registerIndex ){
41 return registers[registerIndex];
44 public static Player getOpponent(){
48 public static Player getProponent(){
52 private static void readOpponent() throws IOException
54 BufferedReader breader = new BufferedReader(new InputStreamReader(System.in));
55 String turnCase = breader.readLine();
59 if("1".equals(turnCase))
61 card = breader.readLine();
62 slot = breader.readLine();
64 else if("2".equals(turnCase))
66 slot = breader.readLine();
67 card = breader.readLine();
74 if(turnCase == null || card == null || slot == null)
83 private static void writeMove()
85 Batch batch = strategy.move(proponent, opponent);
86 System.out.print(batch);
87 proponent.applyBatch(batch);
90 public static boolean getAutoMode()
95 public static void main(String[] args) throws IOException
97 String playerNum = args[0];
99 if("1".equals(playerNum))