Example #1
0
        public void PrettyPrint()
        {
            //Local function to print either a point or the value
            string printCell(int i, int j)
            {
                if (Board[i, j] == 0)
                {
                    return("ยท");
                }

                return(Board[i, j].ToString());
            }

            for (var i = 0; i < Board.GetLength(0); i++)
            {
                if (i % 3 == 0)
                {
                    Chalk.BlueLine("\t\t+---------+---------+---------+");
                }

                Chalk.Blue("\t\t|");
                for (var j = 0; j < Board.GetLength(1); j += 3)
                {
                    Chalk.White($" {printCell(i, j)} ");
                    Chalk.White($" {printCell(i, j+1)} ");
                    Chalk.White($" {printCell(i, j+2)} ");
                    Chalk.Blue("|");
                }
                Chalk.WhiteLine("");
            }
            Chalk.BlueLine("\t\t+---------+---------+---------+");
        }
Example #2
0
 private static void PrintBasicCLI()
 {
     Console.Clear();
     Chalk.BlueLine("\t\t\tSudoku Multi Solver");
     Chalk.White("\n");
     Sudoku.PrettyPrint();
 }
Example #3
0
        private static ICommand ReadCommand()
        {
            Chalk.White(">>");
            var line    = Console.ReadLine();
            var command = parser.ParseCommand(line);

            return(command);
        }