Artifact b38d60ea39d11e6eb880cf91e733ed35fc2b7d63
- File
src/cui_auto_main.d
- 2012-07-14 16:39:50 - part of checkin [fec7ddc502] on branch trunk - Refactoring for ease of changine main solver. (user: kinaba) [annotate]
- 2012-07-15 11:26:58 - part of checkin [bd650eb3f9] on branch trunk - Output is now fully functional. (user: kinaba) [annotate]
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()); }