Advertisement
Guest User

Untitled

a guest
May 26th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace Generator
  7. {
  8. public class randomgenerator
  9. {
  10. public int length; //Length of the Random Array
  11. public string result; //Result from Random Gen
  12.  
  13. public int from;
  14. public int to;
  15.  
  16. int arraynum;
  17.  
  18. public Random rangen;
  19.  
  20. public void Generate()
  21. {
  22. int[] ranarray;
  23. ranarray = new int[length];
  24.  
  25. rangen = new Random();
  26.  
  27. for (int i = 0; i == length - 1; i++)
  28. {
  29. ranarray[arraynum] = rangen.Next(from, to);
  30. arraynum++;
  31.  
  32. }
  33.  
  34. for (int u = 0; u == ranarray.Length; u++)
  35. {
  36. result = result + ranarray[u];
  37. }
  38.  
  39. }
  40.  
  41.  
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement