I congratulate everyone on the coming !!! I study C # and now I decided to write a simple console game, please tell me that it’s not right in my code, that is, it doesn’t compile, and if it doesn’t go through the switch branch, for example, I enter the coordinates 0.0 I press Enter and nothing happens :
using System; using System.Collections.Generic; namespace AppGame { class MainClass { public static void Main(string[] args) { string[,] text = new string[2, 2]; do { text[0, 0] = "Привет Мир!!! Я делаю консольную Игру поддержите проект интеллектуально!"; text[0, 1] = "Hello, World!!!"; text[1, 0] = "В этой комнате лежит книга 20 000 лье под водой!"; text[1, 1] = "Лежит ключ от двери из этого дома!"; Console.WriteLine("Здесь четыре комнаты 1 на 1 при раскладе 2 на 2 это стены"); text[2, 2] = Convert.ToString(ConsoleKey.Enter); text[2, 2] = Convert.ToString(Console.ReadLine()); switch (text[2, 2]) { case "0, 0": { Console.WriteLine(text[0, 0]); break; } case "0,1": { Console.WriteLine(text[0, 1]); break; } case "1,0": { Console.WriteLine(text[1, 0]); break; } case "1,1": { Console.WriteLine(text[1, 1]); break; } default: { Console.WriteLine("\nнет такой локации или команды"); break; } case "чисто": { Console.Clear(); break; } } Console.ReadKey(); } while (true); } } }