Skip to content

Instantly share code, notes, and snippets.

@moul
Last active November 4, 2015 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moul/3d496ac718a6afa1a412 to your computer and use it in GitHub Desktop.
Save moul/3d496ac718a6afa1a412 to your computer and use it in GitHub Desktop.
shikaku
shikaku git:(master) make
go build -o shikakugen ./cmd/shikakugenshikaku git:(master) ./shikakugen -W 4 -H 4 -B 5 --draw-solution --no-machine-output
+---+---+---+---+
|       |       |
+   +   +---+---+
|       |       |
+   +   +---+---+
|       |       |
+---+---+   +   +
|       |       |
+---+---+---+---+shikaku git:(master) ./shikakugen -W 4 -H 4 -B 5 --draw-solution --no-machine-output
+---+---+---+---+
|   |           |
+   +---+---+---+
|   |       |   |
+   +   +   +   +
|   |       |   |
+---+---+---+   +
|           |   |
+---+---+---+---+shikaku git:(master) ./shikakugen -W 20 -H 20 -B 60 --draw-map --no-machine-output --draw-solution
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
|                   |               |   |   |   |       |       |           |   |
+---+---+---+---+---+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|           |       |               |   |   |   |       |       |           |   |
+   +   +   +   +   +   +   +   +   +   +   +---+---+---+---+---+---+---+---+   +
|           |       |               |   |   |                   |           |   |
+---+---+---+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|           |       |               |   |   |                   |           |   |
+   +   +   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
|           |               |       |       |                   |               |
+---+---+---+---+---+---+---+---+---+---+---+   +   +   +   +   +   +   +   +   +
|               |           |       |       |                   |               |
+   +   +   +   +   +   +   +   +   +   +   +---+---+---+---+---+---+---+---+---+
|               |           |       |       |   |       |               |       |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|               |           |       |       |   |       |               |       |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|               |           |       |       |   |       |               |       |
+---+---+---+---+   +   +   +---+---+---+---+---+   +   +   +   +   +   +---+---+
|   |       |   |           |           |       |       |               |       |
+   +   +   +   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+   +   +
|   |       |   |           |               |                   |       |       |
+   +   +   +   +   +   +   +---+---+---+---+---+---+---+---+---+---+---+   +   +
|   |       |   |           |   |               |       |               |       |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|   |       |   |           |   |               |       |               |       |
+   +   +   +---+---+---+---+   +   +   +   +   +---+---+---+---+---+---+---+---+
|   |       |               |   |               |       |       |       |       |
+---+---+---+---+---+---+---+---+---+---+---+---+   +   +   +   +   +   +   +   +
|           |                   |   |           |       |       |       |       |
+   +   +   +   +   +   +   +   +   +---+---+---+---+---+---+---+   +   +   +   +
|           |                   |   |           |               |       |       |
+   +   +   +---+---+---+---+---+---+---+---+---+   +   +   +   +---+---+---+---+
|           |               |                   |               |           |   |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|           |               |                   |               |           |   |
+---+---+---+---+---+---+---+   +   +   +   +   +   +   +   +   +---+---+---+---+
|       |   |               |                   |               |               |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|       |   |               |                   |               |               |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
|     5                               4       2   4           4       6         |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|     6       6               16                                              4 |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|                                         4               10                    |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|                                                                 6             |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
| 6               4           2       2               10          8             |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|                                                                               |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|                     15          8           3                                 |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|         16                                                              6     |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|                                     8           8               16            |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
| 5       10  4               3           2                                     |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|                     9           4               5               2           8 |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|                                 12                  4                         |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|                             3                           8                     |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|             4                                               4                 |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|                                 2       3           4                   6     |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|             10                      3                   20      6             |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|         12                      20                              6           2 |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|                     8                                                         |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
|         2                                                                     |
+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
| 4                       8                                               8     |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+shikaku git:(master) ✗ make && time ./shikakugen -W 4 -H 4 -B 5 --draw-map --no-machine-output --draw-solution
make: Nothing to be done for `all'.
+---+---+---+---+
|           |   |
+---+---+---+   +
|   |       |   |
+   +   +   +   +
|   |       |   |
+   +---+---+---+
|   |           |
+---+---+---+---+

+---+---+---+---+
| 3           3 |
+   +   +   +   +
| 3   4         |
+   +   +   +   +
|               |
+   +   +   +   +
|     3         |
+---+---+---+---+shikaku git:(master) ✗ make && time ./shikakugen -W 8 -H 4 -B 5 --draw-map --draw-solution
make: Nothing to be done for `all'.
T 8 4
2 3 2
10 4 0
6 5 2
9 1 0
5 3 3

+---+---+---+---+---+---+---+---+
|           |                   |
+   +   +   +   +   +   +   +   +
|           |                   |
+   +   +   +---+---+---+---+---+
|           |       |           |
+---+---+---+---+---+   +   +   +
|                   |           |
+---+---+---+---+---+---+---+---+

+---+---+---+---+---+---+---+---+
|     9           10            |
+   +   +   +   +   +   +   +   +
|                               |
+   +   +   +   +   +   +   +   +
|             2       6         |
+   +   +   +   +   +   +   +   +
|             5                 |
+---+---+---+---+---+---+---+---+
./shikakugen -W 8 -H 4 -B 5 --draw-map --draw-solution  0.00s user 0.00s system 70% cpu 0.005 totalshikaku git:(master) ✗ make && time ./shikakugen -W 4 -H 4 -B 5 --draw-map --draw-solution
make: Nothing to be done for `all'.
T 4 4
3 3 1
3 2 0
4 2 1
3 0 1
3 0 3

+---+---+---+---+
|   |           |
+   +---+---+---+
|   |       |   |
+   +   +   +   +
|   |       |   |
+---+---+---+   +
|           |   |
+---+---+---+---+

+---+---+---+---+
|         3     |
+   +   +   +   +
| 3       4   3 |
+   +   +   +   +
|               |
+   +   +   +   +
| 3             |
+---+---+---+---+
./shikakugen -W 4 -H 4 -B 5 --draw-map --draw-solution  0.00s user 0.00s system 70% cpu 0.005 total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment