Created
November 1, 2014 17:39
-
-
Save Collosteam/be47c5ab12fb3ae6e8a3 to your computer and use it in GitHub Desktop.
XO C sharp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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