Untitled
unknown
plain_text
a year ago
2.7 kB
3
Indexable
Never
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp2 { internal class Board { char[,] chars = { { ' ',' ',' ',' ',' ','0','-','-','0','-','-','0',' ',' ',' ',' ',' '}, { ' ',' ',' ',' ',' ',' ','\\',' ','|',' ','/',' ',' ',' ',' ',' ',' '}, { ' ',' ',' ',' ',' ',' ','0','-','0','-','0',' ',' ',' ',' ',' ',' '}, { ' ',' ',' ',' ',' ',' ',' ','\\','|','/',' ',' ',' ',' ',' ',' ',' '}, { 'E',' ',' ',' ','0','-','0','-','0','-','0','-','0',' ',' ',' ','E',}, { '|','\\',' ',' ','|','\\','|','/','|','\\','|','/','|',' ',' ','/','|'}, { '|',' ','E',' ','0','-','0','-','0','-','0','-','0',' ','E',' ','|',}, { '|',' ','|','\\','|','/','|','\\','|','/','|','\\','|','/','|',' ','|'}, { 'E','-','E','-','E','-','E','-','E','-','E','-','E','-','E','-','E',}, { '|',' ','|','/','|','\\','|','/','|','\\','|','/','|','\\','|',' ','|',}, { '|',' ','E',' ','*','-','*','-','*','-','*','-','*',' ','E',' ','|',}, { '|','/',' ',' ','|','/','|','\\','|','/','|','\\','|',' ',' ','\\','|'}, { 'E',' ',' ',' ','*','-','*','-','*','-','*','-','*',' ',' ',' ','E',}, { ' ',' ',' ',' ',' ',' ',' ','/','|','\\',' ',' ',' ',' ',' ',' ',' ',}, { ' ',' ',' ',' ',' ',' ','*','-','*','-','*',' ',' ',' ',' ',' ',' ',}, { ' ',' ',' ',' ',' ',' ','/',' ','|',' ','\\',' ',' ',' ',' ',' ',' ',}, { ' ',' ',' ',' ',' ','*','-','-','*','-','-','*',' ',' ',' ',' ',' ',}, }; public void PrintBoard() { for (int row = 0; row < chars.GetLength(0); row++) { for (int col = 0; col < chars.GetLength(1); col++) { char currentChar = chars[row, col]; if (currentChar == '*') { Console.ForegroundColor = ConsoleColor.Red; } else if (currentChar == '0') { Console.ForegroundColor = ConsoleColor.Blue; } else { Console.ResetColor(); } Console.Write(chars[row, col]); Console.Write(" "); } Console.WriteLine(); } } } }