测试代码:
using System;
using System.Collections.Generic;
using Splash;
namespace SplashCheck
{
class Program
{
static void Main(string[] args)
{
String s = "abcde";
// 测试全排列列表
Console.WriteLine("测试全排列列表");
List<Int32[]> list = FullPermutation.Seed(1, 3);
if (list != null)
{
foreach (Int32[] item in list)
{
for (Int32 i = 0; i < item.Length; i++)
{
if (i != 0) Console.Write(" ");
Console.Write(s[item[i]]);
}
Console.WriteLine();
}
}
// 测试迭代器
Console.WriteLine();
Console.WriteLine("测试迭代器");
foreach (Int32[] item in FullPermutation.Cell(1, 3))
{
for (Int32 i = 0; i < item.Length; i++)
{
if (i != 0) Console.Write(" ");
Console.Write(s[item[i]]);
}
Console.WriteLine();
}
}
}
}