Ejemplo n.º 1
0
 static void ExpressionsStreamDemo() =>
 InputNumberSequences
 .Select(new ExpressionStream().DistinctFor)
 .SelectMany(expressions => Report(expressions, "No expressions found."))
 .WriteLinesTo(Console.Out);
Ejemplo n.º 2
0
 static void CountExpressions() =>
 InputNumberSequences
 .Select(inputs => new ExpressionStream().DistinctFor(inputs).Count())
 .Select(count => $"There are {count} distinct expressions.")
 .WriteLinesTo(Console.Out);
Ejemplo n.º 3
0
 static void PartitioningDemo() =>
 InputNumberSequences
 .SelectMany(numbers => Partitionings.Of(numbers).All())
 .Select(partitioning => partitioning.Select(partition => string.Join(" ", partition.ToArray())))
 .Select(partitions => string.Join(" | ", partitions))
 .WriteLinesTo(Console.Out);
Ejemplo n.º 4
0
 static void GenerateProblems() =>
 InputNumberSequences
 .SelectMany(UniqueExpressionsReport)
 .WriteLinesTo(Console.Out);