1.1 --- a/src/main/java/ru/alphatech/icfpc/game/Run.java Sat Jun 18 19:40:17 2011 +0400
1.2 +++ b/src/main/java/ru/alphatech/icfpc/game/Run.java Sat Jun 18 19:42:15 2011 +0400
1.3 @@ -6,11 +6,16 @@
1.4 package ru.alphatech.icfpc.game;
1.5
1.6 import java.io.BufferedReader;
1.7 +import java.io.File;
1.8 +import java.io.FileWriter;
1.9 import java.io.IOException;
1.10 import java.io.InputStreamReader;
1.11 +import java.io.PrintWriter;
1.12
1.13 public class Run
1.14 {
1.15 + private static boolean endgame = false;
1.16 +
1.17 private static Player proponent = new Player();
1.18
1.19 private static Player opponent = new Player();
1.20 @@ -19,28 +24,36 @@
1.21 {
1.22 BufferedReader breader = new BufferedReader(new InputStreamReader(System.in));
1.23
1.24 - breader.readLine();
1.25 - breader.readLine();
1.26 - breader.readLine();
1.27 + String l1 = breader.readLine();
1.28 + String l2 = breader.readLine();
1.29 + String l3 = breader.readLine();
1.30 +
1.31 + if(l1 == null || l2 == null || l3 == null)
1.32 + {
1.33 + endgame = true;
1.34 + }
1.35 }
1.36
1.37 private static void writeMove()
1.38 {
1.39 - System.out.println(1);
1.40 - System.out.println("I");
1.41 - System.out.println(0);
1.42 + System.out.print(1 + "\n");
1.43 + System.out.print("I" + "\n");
1.44 + System.out.print(0 + "\n");
1.45 }
1.46 -
1.47 +
1.48 public static void main(String[] args) throws IOException
1.49 {
1.50 String playerNum = args[0];
1.51 -
1.52 +
1.53 if("1".equals(playerNum))
1.54 {
1.55 readOpponent();
1.56 }
1.57
1.58 - writeMove();
1.59 - readOpponent();
1.60 + while(!endgame)
1.61 + {
1.62 + writeMove();
1.63 + readOpponent();
1.64 + }
1.65 }
1.66 }