README.md
author Mikael Berthe <mikael@lilotux.net>
Sat, 07 Apr 2018 23:37:05 +0200
changeset 21 db2eacbac9b6
parent 20 1110dfef8964
permissions -rw-r--r--
README: Add gotak examples
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     1
# takuzu
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     2
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     3
Golang takuzu library
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     4
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     5
[![godoc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/McKael/takuzu)
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     6
[![license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://raw.githubusercontent.com/McKael/takuzu/master/LICENSE)
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     7
[![Build Status](https://travis-ci.org/McKael/takuzu.svg?branch=master)](https://travis-ci.org/McKael/takuzu)
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     8
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     9
This repository contains a [Go](https://golang.org/) library package that
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    10
provides functions to solve, build or validate takuzu puzzles.
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    11
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    12
- Mercurial repository: https://hg.lilotux.net/golang/mikael/takuzu/
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    13
- Github mirror: https://github.com/McKael/takuzu/
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    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
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    16
14
f67da1c20c86 Update README
Mikael Berthe <mikael@lilotux.net>
parents: 13
diff changeset
    17
# CLI demo
f67da1c20c86 Update README
Mikael Berthe <mikael@lilotux.net>
parents: 13
diff changeset
    18
13
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    19
This project also contains a command line utility, named `gotak`, to solve or
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    20
generate puzzles.
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    21
I haven't written the tool documentation yet.
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    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
f67da1c20c86 Update README
Mikael Berthe <mikael@lilotux.net>
parents: 13
diff changeset
    24
f67da1c20c86 Update README
Mikael Berthe <mikael@lilotux.net>
parents: 13
diff changeset
    25
```
19
3cd2cd2725bd Fix mistake in README
Mikael Berthe <mikael@lilotux.net>
parents: 17
diff changeset
    26
go get github.com/McKael/takuzu/gotak
14
f67da1c20c86 Update README
Mikael Berthe <mikael@lilotux.net>
parents: 13
diff changeset
    27
```
f67da1c20c86 Update README
Mikael Berthe <mikael@lilotux.net>
parents: 13
diff changeset
    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
f67da1c20c86 Update README
Mikael Berthe <mikael@lilotux.net>
parents: 13
diff changeset
    30
20
1110dfef8964 Update README
Mikael Berthe <mikael@lilotux.net>
parents: 19
diff changeset
    31
Pre-built binaries are available on the
1110dfef8964 Update README
Mikael Berthe <mikael@lilotux.net>
parents: 19
diff changeset
    32
[Github Release page](https://github.com/McKael/takuzu/releases).
1110dfef8964 Update README
Mikael Berthe <mikael@lilotux.net>
parents: 19
diff changeset
    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
f67da1c20c86 Update README
Mikael Berthe <mikael@lilotux.net>
parents: 13
diff changeset
    77
# Online puzzle demo
f67da1c20c86 Update README
Mikael Berthe <mikael@lilotux.net>
parents: 13
diff changeset
    78
13
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    79
This library is used by GotakJS, an [online takuzu puzzle game](https://lilotux.net/~mikael/takuzu/),
16
1cde13306e8f README: Fix typo
Mikael Berthe <mikael@lilotux.net>
parents: 15
diff changeset
    80
written in Go using [GopherJS](https://github.com/gopherjs/gopherjs).
13
923ce3e425cd Add README and Travis file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    81
(On mobile, works best with Chrome.  On a computer, I've tested it with both Firefox and Chrome.)