public string generateStars() { Stack<int> numbers = new Stack<int>(); List<int> list = new List<int>(); Return = ""; int num = rand.Next(1, 10 + 1); numbers.Push(num); num = rand.Next(1, 10 + 1); numbers.Push(num); list = numbers.ToList(); list.Sort(); foreach (int i in list) { Return += " *" + i; } return Return; }
static void Main(string[] args) { Stack stack = new Stack(); do { do { } while ( != 52); } while ( != 4); // 2 looppia ulkona maat(1-4) // numerot // luo kortti // lisää pakkaan }
public string generateLotto(int max, int count) { Stack<int> numbers = new Stack<int>(); List<int> list = new List<int>(); Return = ""; do { int num = rand.Next(1, max + 1); numbers.Push(num); count--; } while (count > 0); list = numbers.ToList(); list.Sort(); foreach (int i in list) { Return += " " + i; } return Return; }