Skip to content

Instantly share code, notes, and snippets.

@Collosteam
Created November 1, 2014 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Collosteam/be47c5ab12fb3ae6e8a3 to your computer and use it in GitHub Desktop.
Save Collosteam/be47c5ab12fb3ae6e8a3 to your computer and use it in GitHub Desktop.
XO C sharp
class Program
{
static void Main(string[] args)
{
int row = 0;
int[,] xoarrey = new int[,]{ { 0, 1, 2 }, { 0, 2, 0 } ,{ 0, 1, 1 } };
for (int i = 0; i < 5; i++) {
if (i % 2 == 0)
{
Console.WriteLine(" " + getSymbol(xoarrey[row, 0]) + " | " + getSymbol(xoarrey[row, 1]) + " | " + getSymbol(xoarrey[row, 2]) + " ");
row++;
}
else {
Console.WriteLine("---+---+----");
}
}
}
public static string getSymbol(int index){
switch(index){
case 0:
return " ";
case 1:
return "O";
case 2:
return "X";
}
return "";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment