RosettaCodeData/Task/Combinations/Elena/combinations.elena

23 lines
347 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
import system'routines;
import extensions;
import extensions'routines;
const int M = 3;
const int N = 5;
Numbers(n)
{
2024-03-06 22:25:12 -08:00
^ Array.allocate(n).populate::(int n => n)
2023-07-01 11:58:00 -04:00
}
2026-02-01 16:33:20 -08:00
public Program()
2023-07-01 11:58:00 -04:00
{
var numbers := Numbers(N);
2024-03-06 22:25:12 -08:00
Combinator.new(M, numbers).forEach::(row)
2023-07-01 11:58:00 -04:00
{
2025-08-11 18:05:26 -07:00
Console.printLine(row.toString())
2023-07-01 11:58:00 -04:00
};
2025-08-11 18:05:26 -07:00
Console.readChar()
2023-07-01 11:58:00 -04:00
}