Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace FifthProject
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.CursorVisible = false;
- int userY = 1;
- int userX = 1;
- int mapSizeX = 0;
- int mapSizeY = 0;
- char[,] map = new char[0,0];
- SettingMap(ref userX, ref userY);
- GenerateMap(ref map, mapSizeX, mapSizeY);
- }
- static int UserInputInt()
- {
- int output;
- bool enterIsCorrect = false;
- do
- {
- string input = Console.ReadLine();
- enterIsCorrect = int.TryParse(input, out output);
- if (!enterIsCorrect)
- {
- Console.WriteLine("Error enter. Try again");
- }
- } while (!enterIsCorrect);
- return output;
- }
- static void SettingMap(ref int x,ref int y)
- {
- Console.WriteLine("Введите ширину карты");
- x = UserInputInt();
- Console.WriteLine("Введите высоту карты");
- y = UserInputInt();
- }
- static void GenerateMap(ref char[,] map, int x, int y)
- {
- char[,] tempMap = new char[x, y];
- map = tempMap;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement