Artifact 8844bb07a00188c537df8c88d21aed203417b2b6
- File
src/cui_auto_main.d
- 2012-07-14 14:33:25 - part of checkin [aea6cfc7e3] on branch trunk - further clean up. (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!Solver_1)(); while(!c.fin) d.command(c.solver.single_step()); }