Guest User

Untitled

a guest
Oct 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. public static IList<参加者> Create()
  2. {
  3. // …前略
  4. }).ToList();
  5.  
  6. int count = list.Count;
  7. var rnd = new Random();
  8. for (int i = 0; i < count; i++)
  9. {
  10. int src = rnd.Next(0, count);
  11. int dest = (src + rnd.Next(1, count)) % count;
  12.  
  13. var tmp = list[dest];
  14. list[dest] = list[src];
  15. list[src] = tmp;
  16. }
  17.  
  18. return list;
  19. }
Add Comment
Please, Sign In to add comment