package net.ciklum.icfpc11.player import net.ciklum.icfpc11.domain.Game import net.ciklum.icfpc11.parser.ArgumentParser import net.ciklum.icfpc11.parser.ArgumentCompiler import net.ciklum.icfpc11.parser.Command import net.ciklum.icfpc11.parser.Application import net.ciklum.icfpc11.domain.cards.ConstantFunction import net.ciklum.icfpc11.domain.Card import net.ciklum.icfpc11.controller.Controller /** * Bot aware of situation * @author mym */ @Typed class Main { static void main(String[] args) { boolean hisTurn = args[0] == '1' def game = Game.instance def controller = new Controller() def parser = new ArgumentParser() def compiler = new ArgumentCompiler() def input = new InputStreamReader(System.in) def output = System.out if (hisTurn) { Command command = parser.parse(input.readLine(), input.readLine(), input.readLine()) controller.hisTurn(game, command) } while (true) { def myturn = new Command(Application.LEFT, 0, Card.zero) controller.myTurn(game, myturn) output.print compiler.compile(myturn) output.flush() Command command = parser.parse(input.readLine(), input.readLine(), input.readLine()) controller.hisTurn(game, command) } } }