Foibs

epilepsy generator 2.0 pinakes me GetLength

Nov 21st, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp1
  4. {
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             Random rnd = new Random();
  10.  
  11.             int[,] array = new int[rnd.Next(0, 100000), rnd.Next(0, 100000)];
  12.  
  13.             for (int k = 0; k < array.GetLength(0); k++)
  14.             {
  15.                 for (int l = 0; l < array.GetLength(1); l++)
  16.                 {
  17.                     array[k, l] = rnd.Next();
  18.                     Console.ForegroundColor = (ConsoleColor)rnd.Next(0, 14);
  19.                     Console.Write("[{0}, {1}] = {2}", k, l, array[k, l]);
  20.                 }
  21.             }
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment