sashab
December 17, 2021, 4:31pm
1
From 8 groups of 4 teams, you have 16 teams advancing to the next stage playoffs.
Rules:
1- A team cannot play against another of the same group from the group-stage.
2- A team cannot face another from the same national league.
What would be the optimal way to model this problem in a functional railway-oriented way.
Something I saw in OO code was one team uber-object with states for each stage of the games and status flags … complicated and just doesn’t look right
This problem seems a better fit for a constrain satisfaction solver, than a pipeline method. Here’s a small sample for a completely different problem just to give you an idea:
Teachers.cs
namespace Csp
{
using System;
using System.Collections.Generic;
using System.Linq;
using Decider.Csp.BaseTypes;
using Decider.Csp.Global;
using Decider.Csp.Integer;
public static class Program
This file has been truncated. show original
output.txt
Monday Tuesday Wednesday Thursday Friday Saturday
0 Mike Katie Ali Mike Katie Ali
1 Mike Mike Mike Mike Mike Mike
2 Katie Mike Mike Katie Mike Ali
3 Mike Katie Katie Mike Katie Ali
4 Katie Katie Mike Katie Katie Katie
5 Katie Ali Katie Katie Ali
6 Ali Ali Ali Ali Ali
7 Ali Mike Katie Ali Mike
Runtime: 00:00:00.1063270
This file has been truncated. show original