Artifact d3f73764386d7688ddfd784dfc361d0026ab6c3c
- File
src/cui_auto_main.d
- 2012-07-14 14:22:32 - part of checkin [a0c3529225] on branch trunk - code cleanup (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, const(Game) g, bool finished) { fin = finished; } } void main(string[] args) { Driver d = new Driver(stdin); d.addObserver!(GuardedOutput)(); auto c = d.addObserver!(CUI!Solver_1)(); while(!c.fin) d.command(c.solver.single_step()); }