package net.thoughtmachine;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class Application {

    private static final String input = "/input.txt";

    public void loadInput() {
        InputStream is = getClass().getResourceAsStream(input);
        BufferedReader reader = new BufferedReader(new InputStreamReader(is));

        try {
            String line;
            while ((line = reader.readLine()) != null) {
                System.out.println(line);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public static void main(String... args) {
        Application app = new Application();
        app.loadInput();
    }
}

@@ -33,59 +33,183 @@
 ort 
-java.io.BufferedReader;%0Aimport java.io.IOException;
+net.thoughtmachine.game.Game;%0Aimport net.thoughtmachine.parser.GameInputParser;%0Aimport net.thoughtmachine.parser.ParsedResult;%0Aimport net.thoughtmachine.printer.BoardPrinter;%0A
 %0Aimp
@@ -221,26 +221,26 @@
 ava.io.I
-nputStream
+OException
 ;%0Aimport
@@ -259,22 +259,16 @@
 utStream
-Reader
 ;%0A%0Apubli
@@ -322,21 +322,29 @@
  String 
-input
+DEFAULT_INPUT
  = %22/inp
@@ -379,20 +379,51 @@
 adInput(
-) %7B%0A
+String input) %7B%0A        try %7B%0A%0A    
         
@@ -435,17 +435,17 @@
 Stream i
-s
+n
  = getCl
@@ -478,24 +478,27 @@
 input);%0A
+%0A  
         
 Buffered
@@ -493,231 +493,329 @@
     
-BufferedReader reader = new BufferedReader(new InputStreamReader(is));%0A%0A        try %7B%0A            String line;%0A            while ((line = reader.readLine()) != null) %7B%0A                System.out.println(line);%0A            %7D
+  GameInputParser parser = new GameInputParser();%0A%0A            ParsedResult result = parser.parseInput(in);%0A%0A            Game game = new Game(result.getBoard());%0A            game.execute(result.getActions());%0A%0A            BoardPrinter printer = new BoardPrinter();%0A            printer.print(game.getBoard(), System.out);%0A
 %0A   
@@ -897,16 +897,88 @@
        %7D
+%0A%0A    %7D%0A%0A    public void loadInput() %7B%0A        loadInput(DEFAULT_INPUT);
 %0A    %7D%0A%0A
@@ -1064,24 +1064,129 @@
 lication();%0A
+%0A        if (args != null && args.length %3E 0) %7B%0A            app.loadInput(args%5B0%5D);%0A        %7D else %7B%0A    
         app.
@@ -1194,20 +1194,30 @@
 oadInput();%0A
+        %7D%0A
     %7D%0A%7D%0A

version 0.1