Artifact Content
Not logged in

Artifact a0394f9b9692c1ebcca12656a438449f3ff3d8dd


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