private string[] Solved() { READER reader = new READER(path); List <List <String> > Da = reader.GetData(); string x = ""; for (int i = 0; i < Da[0].Count; i++) { x = x + Da[0][i]; if (i < Da[0].Count - 1) { x = x + ' '; } } string y = ""; for (int i = 0; i < Da[1].Count; i++) { y = y + Da[1][i]; if (i < Da[1].Count - 1) { y = y + ' '; } } Stopwatch watch = new Stopwatch(); watch.Start(); string result = Nonogram.Solve(x, y); watch.Stop(); UnityEngine.Debug.Log("Tiempo de ejecución = " + watch.Elapsed); Matrix = new List <GameObject>(); return(result.Split('\n')); }
public void SmallMap_Candle() { Nonogram nonogram = new Nonogram(CandleRowHints, CandleColumnHints); var result = nonogram.Solve().Result; for (int row = 0; row < CandleRowHints.Length; row++) { for (int col = 0; col < CandleColumnHints.Length; col++) { Assert.IsTrue(result[row, col] == CandleMap[row, col]); } } }
public void SmallMap_Boat() { Nonogram nonogram = new Nonogram(BoatRowHints, BoatColumnHints); var result = nonogram.Solve().Result; for (int row = 0; row < BoatRowHints.Length; row++) { for (int col = 0; col < BoatColumnHints.Length; col++) { Assert.IsTrue(result[row, col] == BoatMap[row, col]); } } }
public void LargeMap_QuadBike() { Nonogram nonogram = new Nonogram(QuadRowHints, QuadColumnHints); var result = nonogram.Solve().Result; for (int row = 0; row < QuadRowHints.Length; row++) { for (int col = 0; col < QuadColumnHints.Length; col++) { Assert.IsTrue(result[row, col] == QuadMap[row, col]); } } }
static void Main(string[] args) { Nonogram nonogram = new Nonogram(RowHints, ColumnHints, new ConsoleLogger()); nonogram.Solve(); }