Coding Dojo

Edit on Gitlab

Sudoku the concurrent resolver

Inspired from Thien Que Nguyen and Pascal Van Cauwenberghe

This kata whan to experience TDD and concurrent programming.

Cell Specification

Build a Cell class or struct they follow this rules :

A Cell can answer 1 question :

And record one information :

Grid Specification

Grid can record one information :

Region Specification

All regions are organized as follow :

A B C
D E F
G H I

The North output of one region if connected with the South input of the corresponding region.

At west of last column it’s the first column and at south of last line it’s the first one.

For exemple

                         ^            |
                         |            |
                         |            |
                   /output/north  /input/north  
                         |            |
                         |            |
                         |            v
                    +----------------------+
                    |                      |
--- /input/west --->|                      |---- /output/east -->
                    |     Region grid C    |
<-- /output/west ---|                      |<--- /input/east ----
                    |                      |
                    +----------------------+
                         ^            |
                         |            |
                         |            |
                   /input/south  /output/south  
                         |            |
                         |            |
                         |            v

                         ^            |
                         |            |
                         |            |
                   /output/north  /input/north  
                         |            |
                         |            |
                         |            v
                    +----------------------+
                    |                      |
--- /input/west --->|                      |---- /output/east -->
                    |     Region grid F    |
<-- /output/west ---|                      |<--- /input/east ----
                    |                      |
                    +----------------------+
                         ^            |
                         |            |
                         |            |
                   /input/south  /output/south  
                         |            |
                         |            |
                         |            v

A region is a REST server with 2 routes:

POST /input/[direction] with direction in (“north”, “east”, “south”, “west”) and payload :

{
    row:             // immutable
    column:          // immutable
    value:           // immutable
    uuid:            // immutable
    nb-of-msg:       // modified by last region
    path:            // modified by last region
}

POST /init/ and payload :

{
    row:
    column:
    value:
}

When a grid discover a value of a cell

When a grid receive a message from North or South

When a grid receive a message from the East or West

Exemple:

Display server is a REST server with 1 route:

POST /show with payload :

{
    row:             // immutable
    column:          // immutable
    value:           // immutable
    uuid:            // immutable
    nb-of-msg:       // modified by last region
    path:            // modified by last region
}