Overview
SHA1 Hash: | 3014ab5a8a4edd2d16b673729a8a71653b68644a |
---|---|
Date: | 2012-07-15 22:27:45 |
User: | kinaba |
Comment: | Clean up. |
Timelines: | family | ancestors | descendants | both | trunk |
Diffs: | redesign |
Downloads: | Tarball | ZIP archive |
Other Links: | files | file ages | manifest |
Tags And Properties
- branch=trunk inherited from [16f0b5784f]
- sym-trunk inherited from [16f0b5784f]
Changes
Modified src/Makefile from [01a4f7a0531dae71] to [00843a9ae2199a17].
1 1 # To build, the following packages are needed. 2 2 # wget http://ftp.digitalmars.com/dmd_2.059-0_i386.deb 3 3 # sudo apt-get install gcc gcc-multilib 4 4 # sudo pkg -i dmd_2.059-0_i386.deb 5 5 6 6 all: 7 - dmd -O -release -inline -oflifter cui_auto_main.d driver.d game.d output.d solver.d util.d 7 + dmd -O -release -inline -oflifter main.d driver.d game.d output.d solver.d util.d 8 + 9 +gui: 10 + 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 version [b38d60ea39d11e6e]
1 -import util; 2 -import game; 3 -import output; 4 -import driver; 5 -import solver; 6 - 7 -class CUI(Solver) : GameObserver 8 -{ 9 - this(in Game g) { solver = new Solver(g); } 10 - Solver solver; 11 - bool fin; 12 - override void on_game_changed(char c, in Game g, bool finished) 13 - { 14 - fin = finished; 15 - } 16 -} 17 - 18 -void main(string[] args) 19 -{ 20 - Driver d = new Driver(stdin); 21 - d.addObserver!(GuardedOutput)(); 22 - auto c = d.addObserver!(CUI!MainSolver)(); 23 - while(!c.fin) 24 - d.command(c.solver.single_step()); 25 -}
Modified src/gui_main.d from [4375fba2fc66f9ab] to [4124e840a1a49af9].
1 1 import util; 2 2 import gui; 3 3 import output; 4 4 import driver; 5 5 import solver; 6 -import std.stdio; 7 6 pragma(lib, "dfl.lib"); 8 7 9 8 void main(string[] argv) 10 9 { 11 10 bool automate = (argv.length>=2 && std.string.indexOf(argv[1],"auto")>=0); 12 11 13 12 auto d = new Driver(stdin); 14 13 d.addObserver!(GuardedOutput)(); 15 14 d.addObserver!(GUI!MainSolver)().run(&d.command, automate); 16 15 }
Modified src/main.d from [b38d60ea39d11e6e] to [f6cab5c23c5cba1e].
5 5 import solver; 6 6 7 7 class CUI(Solver) : GameObserver 8 8 { 9 9 this(in Game g) { solver = new Solver(g); } 10 10 Solver solver; 11 11 bool fin; 12 - override void on_game_changed(char c, in Game g, bool finished) 13 - { 14 - fin = finished; 15 - } 12 + override void on_game_changed(char c, in Game g, bool finished) { fin = finished; } 16 13 } 17 14 18 -void main(string[] args) 15 +void main() 19 16 { 20 - Driver d = new Driver(stdin); 17 + auto d = new Driver(stdin); 21 18 d.addObserver!(GuardedOutput)(); 22 19 auto c = d.addObserver!(CUI!MainSolver)(); 23 20 while(!c.fin) 24 21 d.command(c.solver.single_step()); 25 22 }