Artifact a0394f9b9692c1ebcca12656a438449f3ff3d8dd
- File
src/cui_auto_main.d
- 2012-07-14 12:51:48 - part of checkin [8a59754e60] on branch trunk - GUI auto solver. (user: kinaba) [annotate]
import util; import game; import output; import driver; import solver; class CUI(Solver) : GameObserver { this(const(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()); }