-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmeta.yml
180 lines (140 loc) · 4.63 KB
/
meta.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
---
fullname: Coqoban
shortname: coqoban
organization: coq-community
community: true
action: true
synopsis: >-
Coqoban (Sokoban in Coq)
description: |-
A Coq implementation of Sokoban, the Japanese warehouse
keeper's game.
authors:
- name: Jasper Stein
initial: true
- name: Hugo Herbelin
maintainers:
- name: Érik Martin-Dorel
nickname: erikmd
opam-file-maintainer: [email protected]
opam-file-version: dev
license:
fullname: GNU Lesser General Public License v2.1 or later
identifier: LGPL-2.1-or-later
supported_coq_versions:
text: 8.10 or later
opam: '{>= "8.10"}'
tested_coq_opam_versions:
- version: 'dev'
- version: '8.20'
- version: '8.19'
- version: '8.18'
- version: '8.17'
- version: '8.16'
- version: '8.15'
- version: '8.14'
- version: '8.13'
- version: '8.12'
- version: '8.11'
- version: '8.10'
namespace: Coqoban
keywords:
- name: Sokoban
- name: puzzle
- name: game
categories:
- name: Miscellaneous/Logical Puzzles and Entertainment
build: |-
## Building instructions
The recommended way to use Coqoban is to build the
project locally:
```shell
git clone https://github.com/coq-community/coqoban.git
cd coqoban
make # or make -j <number-of-cores-on-your-machine>
```
However, you can also build and install the whole project via
[opam](https://opam.ocaml.org/doc/Install.html):
```shell
opam repo add coq-released https://coq.inria.fr/opam/released
opam install coq-coqoban
```
documentation: |
## Documentation
Welcome to Coqoban!
This is a Coq implementation of Sokoban, the Japanese
warehouse keeper's game. The keeper must push the boxes to specified
destination places. He can only push one box at a time, no more, and
he can't pull. How to put the boxes in place?
Thanks to [jsCoq](https://jscoq.github.io), you can play Coqoban
[directly in your browser](https://coq.vercel.app/fun/coqoban.html)
without installing Coq!
If you want to install and run Coq and Coqoban locally:
* [Coqoban\_engine.v](theories/Coqoban_engine.v) contains the actual Sokoban
implementing script/program/data. It has a fair amount of
remarks explaining what's going on, for those interested to know
more about this implementation.
You may just load this file into your favorite Coq editor and play.
* [Coqoban\_levels.v](theories/Coqoban_levels.v) contains 355 levels to be
played with `Coqoban_engine`.
To import both the engine and levels in Coq:
```coq
From Coqoban Require Import Coqoban_levels.
```
The levels are called `Level_1` up to `Level_355`. From
[Coqoban\_levels.v](theories/Coqoban_levels.v):
```coq
(* These Sokoban levels I have taken from the game KSokoban and include all of the *)
(* Sasquatch (1-50), Mas Sasquatch (51-100), Sasquatch III (101-150), Microban *)
(* (151-305), and Sasquatch IV (306-355) collections. These collections are made by *)
(* David W. Skinner ([email protected]) http://users.bentonrea.com/~sasquatch/ *)
```
There are more levels on [this website](http://www.abelmartin.com/rj/sokobanJS/Skinner/David%20W.%20Skinner%20-%20Sokoban.htm).
You can download them and transform them into additional `Coqoban_levels`.v-like files using the Haskell program [ksoq2coqsok.hs](src/ksoq2coqsok.hs).
And obviously you can define your own new levels.
Beware that Coq's lexer requires spaces after `X` and `O`!
See [Coqoban\_engine.v](theories/Coqoban_engine.v) for more details on parsing/printing.
To play, say, e.g.,
```coq
Coq < Goal (solvable Level_274).
1 subgoal
============================
(solvable Level_274)
Unnamed_thm < unfold Level_274. (* Optional but useful *)
1 subgoal
============================
solvable
|> # # # # # # # # # # # # # # <|
|> # _ _ _ _ _ _ # _ _ _ _ _ # <|
+> # _ X + X X _ # _ O _ O O # <|
|> # # _ # # _ # # # _ # # _ # <|
|> _ # _ # _ _ _ _ _ _ _ # _ # <|
|> _ # _ # _ _ _ # _ _ _ # _ # <|
|> _ # _ # # # # # # # # # _ # <|
|> _ # _ _ _ _ _ _ _ _ _ _ _ # <|
|> _ # # # # # # # # # # # # # <|
|><|
```
Boards are represented by rows between `|>` and `<|`. Other signs:
* `_` = open field
* `#` = wall
* `+` = YOU
* `O` = destination square
* `X` = box
* `*` = a box on a destination square
* `o` = YOU, on a destination square
Tactics used to play Coqoban are:
* `n.` (step/push north)
* `e.` (step/push east)
* `s.` (step/push south)
* `w.` (step/push west)
These apply even if there's a wall in the way. You can also use Coq
tacticals, e.g.,
```coq
do 5 n.
Undo 3.
Restart.
Abort.
```
Share and enjoy!
---