public static void Readpath() { try { string text; using (StreamReader sr = new StreamReader(readPath, System.Text.Encoding.Default)) { text = sr.ReadToEnd().ToLower().Trim(); } if (text == "bin") { Bin bs = new Bin(); Menu menu = new Menu(bs); menu.ShowMenu(); } else if (text == "xml") { Xml xs = new Xml(); Menu menu = new Menu(xs); menu.ShowMenu(); } } catch (Exception e) { Console.WriteLine("Ошибка: " + e.Message); } }
static Bin Move(Bin temp, int checkMove, int[,] matrix, int n) { for (int k = 0; k < n; ++k) { Console.Write(matrix[temp.i, temp.j]); Console.Write(' '); switch (checkMove) { case 1: temp.j++; break; case 2: temp.i++; break; case 3: temp.j--; break; case 4: temp.i--; break; } } return temp; }