Index: src/Makefile ================================================================== --- src/Makefile +++ src/Makefile @@ -2,6 +2,9 @@ # wget http://ftp.digitalmars.com/dmd_2.059-0_i386.deb # sudo apt-get install gcc gcc-multilib # sudo pkg -i dmd_2.059-0_i386.deb all: - dmd -O -release -inline -oflifter cui_auto_main.d driver.d game.d output.d solver.d util.d + dmd -O -release -inline -oflifter main.d driver.d game.d output.d solver.d util.d + +gui: + dmd -O -release -inline -ofgui_lifter gui_main.d driver.d game.d output.d solver.d util.d DELETED src/cui_auto_main.d Index: src/cui_auto_main.d ================================================================== --- src/cui_auto_main.d +++ src/cui_auto_main.d @@ -1,25 +0,0 @@ -import util; -import game; -import output; -import driver; -import solver; - -class CUI(Solver) : GameObserver -{ - this(in Game g) { solver = new Solver(g); } - Solver solver; - bool fin; - override void on_game_changed(char c, in Game g, bool finished) - { - fin = finished; - } -} - -void main(string[] args) -{ - Driver d = new Driver(stdin); - d.addObserver!(GuardedOutput)(); - auto c = d.addObserver!(CUI!MainSolver)(); - while(!c.fin) - d.command(c.solver.single_step()); -} Index: src/gui_main.d ================================================================== --- src/gui_main.d +++ src/gui_main.d @@ -1,11 +1,10 @@ import util; import gui; import output; import driver; import solver; -import std.stdio; pragma(lib, "dfl.lib"); void main(string[] argv) { bool automate = (argv.length>=2 && std.string.indexOf(argv[1],"auto")>=0); ADDED src/main.d Index: src/main.d ================================================================== --- src/main.d +++ src/main.d @@ -0,0 +1,22 @@ +import util; +import game; +import output; +import driver; +import solver; + +class CUI(Solver) : GameObserver +{ + this(in Game g) { solver = new Solver(g); } + Solver solver; + bool fin; + override void on_game_changed(char c, in Game g, bool finished) { fin = finished; } +} + +void main() +{ + auto d = new Driver(stdin); + d.addObserver!(GuardedOutput)(); + auto c = d.addObserver!(CUI!MainSolver)(); + while(!c.fin) + d.command(c.solver.single_step()); +}