Exemple #1
0
        static void Main(string[] args)
        {
            var boardModel = new BoardModel();
            var Player     = true;

            while (true)
            {
                if (Player)
                {
                    BoardView.Show(boardModel);
                    Console.Write("Skriv kordinatene til x: ");
                    var position = Console.ReadLine();
                    boardModel.Cross(position);
                    Player = false;
                }
                else
                {
                    BoardView.Show(boardModel);
                    Console.Write("Skriv kordinatene til o: ");
                    var position = Console.ReadLine();
                    boardModel.Circle(position);
                    Player = true;
                }
            }
        }
Exemple #2
0
        public static void Show(BoardModel boardModel)
        {
            var content = boardModel.Content;

            Console.WriteLine("  1 2 3");
            Console.WriteLine(" ┌─────┐");
            Console.Write("A");
            AssignLine(0, content);
            Console.Write("B");
            AssignLine(3, content);
            Console.Write("C");
            AssignLine(6, content);
            Console.WriteLine(" └─────┘");
        }