Cards done. Only interpretation of zero card is under question mark.
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 endgame = false;
21 private static Player proponent = new Player();
23 private static Player opponent = new Player();
25 private static LinkedList<Batch> batches = new LinkedList<Batch>();
27 private static int registers[] = new int[4];
36 private static IStrategy strategy = new SimplyStrategy();
38 public static Slot getRegisterByIndex(int registerIdex){
39 return proponent.getSlot( registers[registerIdex] );
42 public static void clearBatcher(){
43 batches.removeAll(batches);
46 public static void addBatcher(List<Batch> batches){
47 batches.addAll(batches);
50 public static Player getOpponent(){
54 public static Player getProponent(){
58 private static void readOpponent() throws IOException
60 BufferedReader breader = new BufferedReader(new InputStreamReader(System.in));
61 String turnCase = breader.readLine();
65 if("1".equals(turnCase))
67 card = breader.readLine();
68 slot = breader.readLine();
70 else if("2".equals(turnCase))
72 slot = breader.readLine();
73 card = breader.readLine();
80 if(turnCase == null || card == null || slot == null)
86 private static void writeMove()
88 strategy.moving(proponent, opponent, System.out);
91 public static void main(String[] args) throws IOException
93 String playerNum = args[0];
95 if("1".equals(playerNum))