Exemplo n.º 1
0
    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'));
    }
Exemplo n.º 2
0
        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]);
                }
            }
        }
Exemplo n.º 3
0
        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]);
                }
            }
        }
Exemplo n.º 4
0
        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]);
                }
            }
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            Nonogram nonogram = new Nonogram(RowHints, ColumnHints, new ConsoleLogger());

            nonogram.Solve();
        }