author | Mikael Berthe <mikael@lilotux.net> |
Sat, 07 Apr 2018 23:37:05 +0200 | |
changeset 21 | db2eacbac9b6 |
parent 20 | 1110dfef8964 |
permissions | -rw-r--r-- |
13 | 1 |
# takuzu |
2 |
||
3 |
Golang takuzu library |
|
4 |
||
5 |
[![godoc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/McKael/takuzu) |
|
6 |
[![license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://raw.githubusercontent.com/McKael/takuzu/master/LICENSE) |
|
7 |
[![Build Status](https://travis-ci.org/McKael/takuzu.svg?branch=master)](https://travis-ci.org/McKael/takuzu) |
|
8 |
||
9 |
This repository contains a [Go](https://golang.org/) library package that |
|
10 |
provides functions to solve, build or validate takuzu puzzles. |
|
11 |
||
12 |
- Mercurial repository: https://hg.lilotux.net/golang/mikael/takuzu/ |
|
13 |
- Github mirror: https://github.com/McKael/takuzu/ |
|
14 |
||
15
eac7d78ff641
Update gotak import path to fix Travis build
Mikael Berthe <mikael@lilotux.net>
parents:
14
diff
changeset
|
15 |
Please read the [godoc documentation](https://godoc.org/github.com/McKael/takuzu) for details. |
13 | 16 |
|
14 | 17 |
# CLI demo |
18 |
||
13 | 19 |
This project also contains a command line utility, named `gotak`, to solve or |
20 |
generate puzzles. |
|
21 |
I haven't written the tool documentation yet. |
|
22 |
||
17
6b776bd4bbf2
Mention Go v1.8+ is required
Mikael Berthe <mikael@lilotux.net>
parents:
16
diff
changeset
|
23 |
To build the gotak CLI utility, you can use the following command (with Go 1.8+): |
14 | 24 |
|
25 |
``` |
|
19 | 26 |
go get github.com/McKael/takuzu/gotak |
14 | 27 |
``` |
28 |
||
15
eac7d78ff641
Update gotak import path to fix Travis build
Mikael Berthe <mikael@lilotux.net>
parents:
14
diff
changeset
|
29 |
(If you use the Mercurial repository, you have to update the import path manually.) |
14 | 30 |
|
20 | 31 |
Pre-built binaries are available on the |
32 |
[Github Release page](https://github.com/McKael/takuzu/releases). |
|
33 |
||
21
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
34 |
The utility was written for personal use and is not very user-friendly, but it |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
35 |
should be reasonably efficient (I've been able to generate boards up to 50x50). |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
36 |
Here are a few examples to get started: |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
37 |
|
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
38 |
Build new 6x6 puzzle: |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
39 |
``` |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
40 |
% gotak --new 6 |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
41 |
|
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
42 |
. . . . . . |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
43 |
0 . . . . 0 |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
44 |
. . 1 . . . |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
45 |
. . . . 1 . |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
46 |
1 . 0 0 . . |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
47 |
1 . . . . . |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
48 |
``` |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
49 |
|
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
50 |
Solve the board: |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
51 |
``` |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
52 |
% gotak --board ......0....0..1.......1.1.00..1..... |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
53 |
|
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
54 |
. . . . . . |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
55 |
0 . . . . 0 |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
56 |
. . 1 . . . |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
57 |
. . . . 1 . |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
58 |
1 . 0 0 . . |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
59 |
1 . . . . . |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
60 |
|
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
61 |
|
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
62 |
0 1 1 0 0 1 |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
63 |
0 1 0 1 1 0 |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
64 |
1 0 1 1 0 0 |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
65 |
0 0 1 0 1 1 |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
66 |
1 1 0 0 1 0 |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
67 |
1 0 0 1 0 1 |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
68 |
``` |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
69 |
|
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
70 |
(You can get the board string with the `--out` flag when generating new puzzles.) |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
71 |
|
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
72 |
Create a PDF with a takuzu puzzle: |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
73 |
``` |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
74 |
% gotak --new 10 --to-pdf /tmp/takuzu.pdf |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
75 |
``` |
db2eacbac9b6
README: Add gotak examples
Mikael Berthe <mikael@lilotux.net>
parents:
20
diff
changeset
|
76 |
|
14 | 77 |
# Online puzzle demo |
78 |
||
13 | 79 |
This library is used by GotakJS, an [online takuzu puzzle game](https://lilotux.net/~mikael/takuzu/), |
16 | 80 |
written in Go using [GopherJS](https://github.com/gopherjs/gopherjs). |
13 | 81 |
(On mobile, works best with Chrome. On a computer, I've tested it with both Firefox and Chrome.) |