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;
- namespace TRUERPG
- {
- class Matrix
- {
- const int Rows = 5;
- const int Cols = 5;
- public string[,] Map = new string[Rows, Cols];
- public void CreateMap(string[,] Map)
- {
- for (int ROW = 0; ROW < Rows; ROW++)
- {
- for (int COL = 0; COL < Cols; COL++)
- {
- for (int rand = 0; rand < COL; rand++)
- {
- Random randome = new Random();
- if (randome.NextDouble() > 0.8)
- {
- Map[ROW, COL] = "#";
- }
- else
- {
- Map[ROW, COL] = ".";
- }
- }
- Console.Write(Map[ROW,COL]);
- }
- Console.WriteLine();
- }
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- string[,] Map = new string[5, 5];
- Matrix MapTest = new Matrix();
- MapTest.CreateMap(Map);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement