Exemple #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+---------+---------+---------+");
        }
Exemple #2
0
 private static void Main(string[] args)
 {
     Chalk.Red(string.Format("asdf{0}", "ludmal"));
     Chalk.Blue("blue");
     Chalk.Green("green");
     Chalk.Yellow("yellow");
     Chalk.Gray("gray");
 }