Miscellany
public text v1 · immutablestatic Stack<int> RandStack (int size)
{
if (size < 1)
throw new ArgumentException("Value of stacks parameter cannot be less than 1.", "value");
Stack<int> mystack = new Stack<int>(size);
Random rand = new Random();
for (int i = 0; i < size; i++)
{
mystack.Push(rand.Next(0, 99));
}
return mystack;
}