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;
16 private static boolean endgame = false;
18 private static Player proponent = new Player();
20 private static Player opponent = new Player();
22 private static LinkedList<Batch> batches = new LinkedList<Batch>();
24 private static int registers[] = new int[4];
33 public static Slot getRegisterByIndex(int registerIdex){
34 return proponent.getSlot( registers[registerIdex] );
37 public static void clearBatcher(){
38 batches.removeAll(batches);
41 public static void addBatcher(List<Batch> batches){
42 batches.addAll(batches);
45 public static Player getOpponent(){
49 public static Player getProponent(){
53 private static void readOpponent() throws IOException
55 BufferedReader breader = new BufferedReader(new InputStreamReader(System.in));
56 String turnCase = breader.readLine();
60 if("1".equals(turnCase))
62 card = breader.readLine();
63 slot = breader.readLine();
65 else if("2".equals(turnCase))
67 slot = breader.readLine();
68 card = breader.readLine();
75 if(turnCase == null || card == null || slot == null)
81 private static void writeMove()
83 System.out.print(1 + "\n");
84 System.out.print("I" + "\n");
85 System.out.print(0 + "\n");
88 public static void main(String[] args) throws IOException
90 String playerNum = args[0];
92 if("1".equals(playerNum))