src/main/java/ru/alphatech/icfpc/game/Run.java
author indvdum
Sat, 18 Jun 2011 19:44:53 +0400
changeset 22 a847184e5468
parent 15 380a98ded3a0
child 29 9f1b16124685
child 31 7b9682308866
permissions -rw-r--r--
+ executable bins
     1 /***********************************************
     2  * icfpc-2011
     3  * بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِِ
     4  * Time: 18.06.2011 11:37:46
     5  ***********************************************/
     6 package ru.alphatech.icfpc.game;
     7 
     8 import java.io.BufferedReader;
     9 import java.io.File;
    10 import java.io.FileWriter;
    11 import java.io.IOException;
    12 import java.io.InputStreamReader;
    13 import java.io.PrintWriter;
    14 
    15 public class Run
    16 {
    17 	private static boolean endgame = false;
    18 	
    19 	private static Player proponent = new Player();
    20 	
    21 	private static Player opponent = new Player();
    22 	
    23 	private static void readOpponent() throws IOException
    24 	{
    25 		BufferedReader breader = new BufferedReader(new InputStreamReader(System.in));
    26 		
    27 		String l1 = breader.readLine();
    28 		String l2 = breader.readLine();
    29 		String l3 = breader.readLine();
    30 		
    31 		if(l1 == null || l2 == null || l3 == null)
    32 		{
    33 			endgame = true;
    34 		}
    35 	}
    36 	
    37 	private static void writeMove()
    38     {
    39 		System.out.print(1 + "\n");
    40 		System.out.print("I" + "\n");
    41 		System.out.print(0 + "\n");
    42     }
    43 	
    44 	public static void main(String[] args) throws IOException
    45     {
    46 	    String playerNum = args[0];
    47 
    48 	    if("1".equals(playerNum))
    49 	    {
    50 	    	readOpponent();
    51 	    }
    52 	    
    53 	    while(!endgame)
    54 	    {
    55 		    writeMove();
    56 		    readOpponent();
    57 	    }
    58     }
    59 }