RosettaCodeData/Task/Combinations/Elena/combinations.elena

23 lines
345 B
Text
Raw Permalink Normal View History

2019-09-12 10:33:56 -07:00
import system'routines;
import extensions;
import extensions'routines;
2014-01-17 05:32:22 +00:00
2019-09-12 10:33:56 -07:00
const int M = 3;
const int N = 5;
2014-01-17 05:32:22 +00:00
2019-09-12 10:33:56 -07:00
Numbers(n)
{
^ Array.allocate(n).populate:(int n => n)
}
2014-01-17 05:32:22 +00:00
2019-09-12 10:33:56 -07:00
public program()
{
var numbers := Numbers(N);
Combinator.new(M, numbers).forEach:(row)
{
console.printLine(row.toString())
};
2017-09-23 10:01:46 +02:00
2019-09-12 10:33:56 -07:00
console.readChar()
}