Skip to content

Instantly share code, notes, and snippets.

@cosminpopescu14
Created November 16, 2020 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cosminpopescu14/c64989f91adbfd9a0fe501ea5f0e8760 to your computer and use it in GitHub Desktop.
Save cosminpopescu14/c64989f91adbfd9a0fe501ea5f0e8760 to your computer and use it in GitHub Desktop.
using System;
using System.Linq;
namespace Craaash
{
class Program
{
static void Main(string[] args)
{
Random random = new();
var x = Enumerable.Range(1, 500)
.Select(r => random.Next(500)) // do not put random in linq!!!
.Where(value => value > 0)
.Take(25);
//.ToHashSet();
Console.WriteLine("Count: {0}", x.Count());
foreach (var item in x)
{
Console.WriteLine(item);
}
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment