Artifact Content
Not logged in

Artifact d3f73764386d7688ddfd784dfc361d0026ab6c3c


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, 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());
}