Artifact Content
Not logged in

Artifact f6cab5c23c5cba1e0f0d9394edd0e0bf650c3022


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()
{
	auto d = new Driver(stdin);
	d.addObserver!(GuardedOutput)();
	auto c = d.addObserver!(CUI!MainSolver)();
	while(!c.fin)
		d.command(c.solver.single_step());
}