File: README.html

package info (click to toggle)
freecell-solver 5.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,256 kB
  • sloc: ansic: 28,700; perl: 10,050; xml: 5,600; python: 1,339; sh: 533; cpp: 275; makefile: 20; javascript: 8
file content (279 lines) | stat: -rw-r--r-- 9,426 bytes parent folder | download | duplicates (4)
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="UTF-8"/>
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"/><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="generator" content="Asciidoctor 1.5.7.1"/>
<meta name="author" content="Shlomi Fish"/>
<title>Freecell Solver Readme File</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"/>
<link rel="stylesheet" href="./asciidoctor.css"/>
</head>
<body class="article">
<div id="header">
<h1>Freecell Solver Readme File</h1>
<div class="details">
<span id="author" class="author">Shlomi Fish</span><br/>
<span id="email" class="email"><a href="mailto:shlomif@cpan.org">shlomif@cpan.org</a></span><br/>
</div>
</div>
<div id="content">
<div class="sect1">
<h2 id="intro">Introduction</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This is Freecell Solver version 5.0.x, a program that automatically
solves most layouts of Freecell, and similar Solitaire variants as
well as those of Simple Simon.</p>
</div>
<div class="paragraph">
<p>Freecell Solver is distributed under the MIT/Expat License
( <a href="http://en.wikipedia.org/wiki/MIT_License" class="bare">http://en.wikipedia.org/wiki/MIT_License</a> ), a free, permissive,
open-source license.</p>
</div>
<div class="paragraph">
<p>Note that the Freecell Solver source and Win32 binary distributions <strong>do not</strong>
provide a graphical user-interface (GUI) and are primarily meant to be used
by Solitaire researchers and software developers. If you&#8217;re looking for a
suitable GUI based on Freecell Solver, see our links at:</p>
</div>
<div class="paragraph">
<p><a href="http://fc-solve.shlomifish.org/links.html#front_ends" class="bare">http://fc-solve.shlomifish.org/links.html#front_ends</a></p>
</div>
<div class="paragraph">
<p>I hope you&#8217;ll enjoy using Freecell Solver, and make the best of it.</p>
</div>
<div class="paragraph">
<p>&#8201;&#8212;&#8201;Shlomi Fish ( <a href="http://www.shlomifish.org/" class="bare">http://www.shlomifish.org/</a> )</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="build">Building</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Read the file <code>INSTALL.txt</code> for information on how to do that.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="usage">Usage</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The program is called "fc-solve". You invoke it like this:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>fc-solve board_file</pre>
</div>
</div>
<div class="paragraph">
<p>board_file is the filename with a valid Freecell startup board. The file is
built as follows:</p>
</div>
<div class="paragraph">
<p>It has the 8 Freecell stacks.</p>
</div>
<div class="paragraph">
<p>Each stack contains its cards separated by a whitespace
and terminated with a newline character( it&#8217;s important that the last stack
will also be terminated with a newline !). The cards in the line are ordered
from the topmost card (= the card right on the virtual table and the one with
the most cards placed on it) in the left, to the bottommost card in the right
(= the card with no other cards placed on it).</p>
</div>
<div class="paragraph">
<p>A card string contains the rank of the card followed by its suit.
The card number is one of: <code>A,1,2,3,4,5,6,7,8,9,10,J,Q,K</code>. Alternatively,
<code>T</code> can be used instead of <code>10</code>. The card suit is one of:  <code>H,S,D,C</code> (standing
for Hearts, Spades, Diamonds and Clubs respectively).</p>
</div>
<div class="paragraph">
<p>Here is an example board: (PySol/Microsoft board No. 24)</p>
</div>
<div class="listingblock">
<div class="content">
<pre>4C 2C 9C 8C QS 4S 2H
5H QH 3C AC 3H 4H QD
QC 9S 6H 9H 3S KS 3D
5D 2S JC 5C JH 6D AS
2D KD 10H 10C 10D 8D
7H JS KH 10S KC 7C
AH 5S 6S AD 8H JD
7S 6C 7D 4D 8S 9D</pre>
</div>
</div>
<div class="paragraph">
<p>Visually, it appears as this:</p>
</div>
<div class="paragraph">
<p><span class="image"><img src="http://fc-solve.shlomifish.org/images/pysol-freecell-ms24.png" alt="Freecell Deal No. 24"/></span></p>
</div>
<div class="paragraph">
<p>As can be seen, the four of clubs (4C), five of hearts (5H), etc. are at the
bottom of the stacks and the start of the lines in the board input.</p>
</div>
<div class="paragraph">
<p>And another one: (PySol board No. 198246790)</p>
</div>
<div class="listingblock">
<div class="content">
<pre>KD JH 5H 7D 9H KC 9D
3H JD 5D 8H QH 7H 2D
4D 3S QC 3C 6S QS KS
10C 9S 6D 9C QD 8S 10D
10S 8C 7S 10H 2C AS
8D AC AH 4H JC 4C
6H 7C 4S 5S 5C JS
AD KH 6C 2H 3D 2S</pre>
</div>
</div>
<div class="paragraph">
<p>Starting from Freecell Solver 3.14.x, a stack can also start with a leading
colon (":"). This is to allow input from states as output by Freecell Solver
using the -p option.</p>
</div>
<div class="paragraph">
<p>You can specify the contents of the freecells by prefixing the line with
"FC:" or with "Freecells:". For example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>FC: 3H QC</pre>
</div>
</div>
<div class="paragraph">
<p>will specify that the cards 3 of hearts and queen of clubs are present in
the freecells. To specify an empty freecell use a "-" as its designator.</p>
</div>
<div class="paragraph">
<p>If there&#8217;s another "FC:" line, the previous line will be overridden.</p>
</div>
<div class="paragraph">
<p>You can specify the contents of the foundations by prefixing the line with
"Founds:" or with "Foundations:" and then using a format as follows:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>Founds: H-5 C-A S-0 D-K</pre>
</div>
</div>
<div class="paragraph">
<p>Hence, the suit ID followed by a dash followed by the card number in the
foundation. A suit that is not present will be assumed to be 0. Again, if
there&#8217;s more than one line like that, then the previous lines will be
ignored and overridden.</p>
</div>
<div class="paragraph">
<p>The program will stop processing the input as soon as it read 8 lines of
standard stacks. Therefore, it is recommended that the foundations and
freecells lines will come at the beginning of the file.</p>
</div>
<div class="paragraph">
<p>The program will process the board and try to solve it. If it succeeds it
will output the states from the initial board to its final solution to the
standard output. If it fails, it will notify it.</p>
</div>
<div class="paragraph">
<p>For information about the various command-line switches that Freecell
Solver accepts, read the <code>USAGE.txt</code> file in this directory.</p>
</div>
<div class="paragraph">
<p>To solve Simple Simon boards append <code>--game simple_simon</code> right after
the "fc-solve" program name.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="board_gen_programs">The board generation programs</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Several programs which can generate the initial boards of various Freecell
implementations can be found in the "board_gen/" sub-directory. Read the
<code>README.txt</code> file there for details on how they can be compiled and used.</p>
</div>
<div class="paragraph">
<p>In any case, they can save you the time of inputting the board yourself.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="complete_examples">Some complete examples for layouts</h2>
<div class="sectionbody">
<div class="paragraph">
<p>A layout in the middle of the MS Freecell deal No. 109 solution:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>Foundations: H-6 C-9 D-2 S-0
Freecells:  QS  3S  2S  KD
: 8H 3D
: KS QD JC
: AS 8D TD 7D JH TS 9D
: 7S 6D
: 5S
: KH QC JD TC 9H 8S 7H 6S 5D 4S
: KC QH JS TH 9S
: 4D</pre>
</div>
</div>
<div class="paragraph">
<p>Similar, but with an empty Freecell:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>Foundations: H-6 C-9 D-2 S-0
Freecells:  QS  3S  -  KD
: 8H 3D 2S
: KS QD JC
: AS 8D TD 7D JH TS 9D
: 7S 6D
: 5S
: KH QC JD TC 9H 8S 7H 6S 5D 4S
: KC QH JS TH 9S
: 4D</pre>
</div>
</div>
<div class="paragraph">
<p>Likewise, only without leading colons where unnecessary:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>Foundations: H-6 C-9 D-2 S-0
Freecells:  QS  3S  -  KD
8H 3D 2S
KS QD JC
AS 8D TD 7D JH TS 9D
7S 6D
5S
KH QC JD TC 9H 8S 7H 6S 5D 4S
KC QH JS TH 9S
4D</pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how_to_read_sol">How to read the solutions</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The file <code>USAGE.txt</code> covers all of Freecell Solver’s command line options,
but it may be too exhaustive for casual users. As a result, here is a shorter
tutorial. First of all whenever invoking <code>fc-solve</code> one should add the
flags <code>-p -t -sam -sel</code> which will make the solution easier to understand. Then,
assuming the board could be successfully solved, one will be given the layouts
in the solution (in the format given above) vis-a-vis with the moves as the
string. Note that the indexes of the resources given in the moves are
0-based rather than the more natural 1-based notation.</p>
</div>
</div>
</div>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2018-10-27 19:03:53 IDT
</div>
</div>
</body>
</html>