Skip to content

Instantly share code, notes, and snippets.

@kawakawa
Created December 16, 2013 14:30
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 kawakawa/7987818 to your computer and use it in GitHub Desktop.
Save kawakawa/7987818 to your computer and use it in GitHub Desktop.
Linqでランダムに値を集める方法
int seed = Environment.TickCount;
var rand = new Random(seed);
int toSkip = rand.Next(0, this.targetList.Count - 1);
var status = this.targetList
.Skip(toSkip)
.Take(1)
.FirstOrDefault();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment