Diff
Not logged in

Differences From Artifact [25b34c42eebd93c9]:

To Artifact [a0394f9b9692c1eb]:


1 import util; 1 import util; 2 import game; 2 import game; 3 import output; 3 import output; 4 import driver; 4 import driver; 5 import solver; 5 import solver; > 6 > 7 class CUI(Solver) : GameObserver > 8 { > 9 this(const(Game) g) { > 10 solver = new Solver(g); > 11 } > 12 Solver solver; > 13 bool fin; > 14 override void on_game_changed(char c, const(Game) g, bool finished) > 15 { > 16 fin = finished; > 17 } > 18 } 6 19 7 void main(string[] args) 20 void main(string[] args) 8 { 21 { 9 Driver d = new Driver(stdin); 22 Driver d = new Driver(stdin); 10 d.addObserver!(GuardedOutput)(); 23 d.addObserver!(GuardedOutput)(); 11 Solver s = d.addObserver!(Solver)(); | 24 auto c = d.addObserver!(CUI!Solver_1)(); > 25 while(!c.fin) 12 s.run(&d.command); | 26 d.command(c.solver.single_step()); 13 } 27 }