Artifact Content
Not logged in

Artifact 80ad58f91e39ad6693e371ec82357e84fa9ada8b


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)();
	d.addObserver!(StdOutput)();
//	auto c = d.addObserver!(CUI!MainSolver)();
	auto c = d.addObserver!(CUI!Solver_0)();
	while(!c.fin)
		d.command(c.solver.single_step());
}