using System;
namespace ShuffleNik
{
class Program
{
static void Main(string[] args)
{
////////////////////////////////////////////////////////////////////////////////
Shuffle<int> shuffleInt = new Shuffle<int>(new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 });
for (int i = 0; i < 100; i++)
{
Console.Write("shuffle[{0}] = ", i + 1);
foreach (int j in shuffleInt.Next())
{
Console.Write("{0} ", j);
}
Console.WriteLine("");
}
Console.Write("=================================================");
Console.ReadLine();
////////////////////////////////////////////////////////////////////////////////
Shuffle<double> shuffleFloat =
new Shuffle<double>(new double[] { 1.56, 2.86, 3.57, 4.56, 5.98, 6.35, 7.87, 8.69, 9.38, 10.57, 11.57, 12.74, 13.03, 14.46, 15.92 });
for (int i = 0; i < 100; i++)
{
Console.Write("shuffle[{0}] = ", i + 1);
foreach (double j in shuffleFloat.Next())
{
Console.Write("{0} ", j);
}
Console.WriteLine("");
}
Console.Write("=================================================");
Console.ReadLine();
////////////////////////////////////////////////////////////////////////////////
Shuffle<Customer> shuffleCustomer =
new Shuffle<Customer>(new Customer[] { new Customer("Sidorov"),
new Customer("Petrov"),
new Customer("Ivanov"),
new Customer("Strunov"),
new Customer("Klinkin"),
new Customer("Mironov"),
new Customer("Smirnov")
});
for (int i = 0; i < 100; i++)
{
Console.Write("shuffle[{0}] = ", i + 1);
foreach (Customer customer in shuffleCustomer.Next())
{
Console.Write("{0} ", customer.Name);
}
Console.WriteLine("");
}
Console.Write("=================================================");
Console.ReadLine();
}
}
}
Класс Customer определяется так
namespace ShuffleNik
{
class Customer
{
string _name;
public Customer(string name){ _name = name; }
public string Name
{
get{ return _name; }
}
}
}