Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.IO;
- namespace Study
- {
- class Program
- {
- static void Main(string[] args)
- {
- char[,] map=ReadMap("map1");
- }
- static void DrawMap(char[,] map) {
- for (int i = 0; i < map.GetLength(0); i++)
- {
- for (int j = 0; j < map.GetLength(1); j++)
- {
- Console.Write(map[i,j]);
- }
- Console.WriteLine();
- }
- }
- static char[,] ReadMap(string mapName)
- {
- string[] newFile = File.ReadAllLines($"Maps/{mapName}.txt");
- char[,] map=new char[newFile.Length,newFile[0].Length];
- for (int i = 0; i < map.GetLength(0); i++)
- {
- for (int j = 0; j < map.GetLength(1); j++)
- {
- map[i, j] = newFile[i][j];
- }
- }
- return map;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement