Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp1
- {
- class Program
- {
- static string[] pos = new string[9] { "0", "1", "2", "3", "4", "5", "6", "7", "8" };
- static void print()
- {
- Console.WriteLine(" {0} | {1} | {2} ", pos[0], pos[1], pos[2]);
- Console.WriteLine(" ----------");
- Console.WriteLine(" {0} | {1} | {2} ", pos[3], pos[4], pos[5]);
- Console.WriteLine(" ----------");
- Console.WriteLine(" {0} | {1} | {2} ", pos[6], pos[7], pos[8]);
- }
- static void Main(string[] args)
- {
- print();
- Console.WriteLine("\nPlayer 1: Chose a number to begin");
- int i = int.Parse(Console.ReadLine());
- if(i > 0 && i < 8)
- {
- pos[i] = "X";
- }
- else
- {
- Console.WriteLine("Wrong input, please try again");
- }
- print();
- Console.WriteLine("\nPlayer 2: Chose a number to begin");
- int j = int.Parse(Console.ReadLine());
- if (j > 0 && j < 8)
- {
- pos[j] = "O";
- }
- else
- {
- Console.WriteLine("Wrong input, please try again");
- }
- print();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement