| CombinationItem Property |
Get a element of the
Combination at the supplied column.
Namespace:
Kaos.Combinatorics
Assembly:
KaosCombinatorics (in KaosCombinatorics.dll) Version: 5.0.0.6
Syntax public int this[
int index
] { get; }
Parameters
- index
- Type: SystemInt32
Zero-based index value.
Return Value
Type:
Int32Sequence value at
index.
Exceptions Examples using System;
using System.Linq;
using Kaos.Combinatorics;
namespace ExampleApp
{
class CnExample05
{
static void Main()
{
var cn = new Combination (choices:10, picks:7, rank:110);
Console.WriteLine ($"n={cn.Choices}, k={cn.Picks}, rank={cn.Rank}:\n");
var text = String.Concat (cn.Select (ei => (char) ('A' + ei)));
Console.WriteLine ($"{text}\n");
for (int i = 0; i < cn.Picks; ++i)
Console.WriteLine ($"Element at {i} is {cn[i]}");
}
}
}
See Also