Untitled
unknown
plain_text
2 years ago
2.7 kB
11
Indexable
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();
}
}
}
}
Editor is loading...