Ejemplo n.º 1
0
 private static MaskedPlace StepOneDecisionTable(MaskedPlace place, int seatsOccupied)
 {
     return(seatsOccupied switch
     {
         0 => place with {
             Position = Position.OccupiedSeat
         },
Ejemplo n.º 2
0
        static void Execute(Position[][] space, int height, int width, Func <int, int, int, int, Position[][], Mask[]> maskGenerator, Func <MaskedPlace, int, MaskedPlace> stepOneDecisionTable, bool showLog)
        {
            var workspaces = new MaskedPlace[2][];

            workspaces[0] = CreateEmptyWorkspace(space, height, width, maskGenerator);
            workspaces[1] = new MaskedPlace[workspaces[0].Length];
            if (showLog)
            {
                Print(workspaces[0], width);

                PrintMasks(workspaces[0], width);
            }
            ExecuteStrategy(width, workspaces, stepOneDecisionTable, showLog);
        }