public static void Main()
byte[,] gameValues2D = new byte[3,3] {{0,0,0},{0,0,0},{0,0,0}};
bool userBlocked = false;
PrintGameBoard(gameValues2D);
Console.WriteLine("Please make your selection for '{0}' or enter 'q' to quit..", ConvertToXO(currentPiece));
number=Console.ReadLine();
if (gameValues2D[2,0] != 0 )
Console.WriteLine(" You cannot place it there. Try it again.");
gameValues2D[2,0] = currentPiece;
if (gameValues2D[2,1] != 0 )
Console.WriteLine(" You cannot place it there. Try it again.");
gameValues2D[2,1] = currentPiece;
if (gameValues2D[2,2] != 0 )
Console.WriteLine(" You cannot place it there. Try it again.");
gameValues2D[2,2] = currentPiece;
if (gameValues2D[1,0] != 0 )
Console.WriteLine(" You cannot place it there. Try it again.");
gameValues2D[1,0] = currentPiece;
if (gameValues2D[1,1] != 0 )
Console.WriteLine(" You cannot place it there. Try it again.");
gameValues2D[1,1] = currentPiece;
if (gameValues2D[1,2] != 0 )
Console.WriteLine(" You cannot place it there. Try it again.");
gameValues2D[1,2] = currentPiece;
if (gameValues2D[0,0] != 0 )
Console.WriteLine(" You cannot place it there. Try it again.");
gameValues2D[0,0] = currentPiece;
if (gameValues2D[0,1] != 0 )
Console.WriteLine(" You cannot place it there. Try it again.");
gameValues2D[0,1] = currentPiece;
if (gameValues2D[0,2] != 0 )
Console.WriteLine(" You cannot place it there. Try it again.");
gameValues2D[0,2] = currentPiece;
PrintGameBoard(gameValues2D);
while( number !="Q" && number !="q");
Console.WriteLine("Thank you for playing!");
public static void PrintGameBoard(byte[,] values)
Console.WriteLine("================");
Console.WriteLine("| {0,1} | {1,1} | {2,1} | | 7 | 8 | 9 |",ConvertToXO(values[0,0]), ConvertToXO(values[0,1]), ConvertToXO(values[0,2]));
Console.WriteLine("|----+----+----|");
Console.WriteLine("| {0,1} | {1,1} | {2,1} | | 4 | 5 | 6 |", ConvertToXO(values[1,0]), ConvertToXO(values[1,1]), ConvertToXO(values[1,2]));
Console.WriteLine("|----+----+----|");
Console.WriteLine("| {0,1} | {1,1} | {2,1} | | 1 | 2 | 3 |", ConvertToXO(values[2,0]), ConvertToXO(values[2,1]), ConvertToXO(values[2,2]));
Console.WriteLine("================");
public static string ConvertToXO(byte values)