~ubuntu-branches/debian/jessie/aisleriot/jessie

« back to all changes in this revision

Viewing changes to games/plait.scm

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Jeremy Bicha, Jordi Mallach
  • Date: 2012-04-22 12:49:26 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120422124926-gmr0thwstl91jt1n
Tags: 1:3.4.1-1
[ Jeremy Bicha ]
* New upstream release
* debian/control.in: (Build)-depend on guile-2.0
* debian/*.install: Cards files are now stored as zipped .svg's
* debian/patches/99_format-security.patch: Dropped, applied upstream

[ Jordi Mallach ]
* New upstream release.
* Update copyright to final version of the machine-readable 1.0 spec.
* Bump Standards Version to 3.9.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
; You should have received a copy of the GNU General Public License
18
18
; along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
19
 
 
20
(use-modules (aisleriot interface) (aisleriot api))
 
21
 
20
22
;; @(#) $Id: plait.scm,v 1.14 2005/07/10 07:08:54 callum Exp $
21
23
 
22
24
;; Constants
88
90
  (and (not (null? home-list))
89
91
       (if (and (not (empty-slot? slot))
90
92
                (move-possible? (get-top-card slot) (car home-list)))
91
 
           (if (not (empty-slot? (car home-list)))
92
 
               (list 1 (get-name (get-top-card slot))
93
 
                     (get-name (get-top-card (car home-list))))
94
 
               (list 0 (format #f (_"Move ~a to an empty field") (get-name (get-top-card slot)))))
 
93
           (hint-move slot 1 (car home-list))
95
94
           (get-valid-move slot (cdr home-list)))))
96
95
 
97
96
(define (get-valid-moves slot-list home-list)
163
162
  (shuffle-deck)
164
163
 
165
164
  (get-and-increment-position-half)
166
 
  (add-normal-slot '())
167
 
  (add-blank-slot)
168
 
  (add-extended-slot '() down)
169
 
  (add-blank-slot)
170
 
  (add-normal-slot '())
 
165
  (add-normal-slot '() 'edge)
 
166
  (add-blank-slot)
 
167
  (add-extended-slot '() down 'plait)
 
168
  (add-blank-slot)
 
169
  (add-normal-slot '() 'edge)
171
170
  (get-and-increment-position-half)
172
171
  (add-blank-slot)
173
172
  (add-blank-slot)
174
 
  (add-normal-slot '())
175
 
  (add-normal-slot '())
 
173
  (add-normal-slot '() 'foundation)
 
174
  (add-normal-slot '() 'foundation)
176
175
  (add-carriage-return-slot)
177
176
 
178
 
  (add-normal-slot '())
179
 
  (add-normal-slot '())
180
 
  (add-blank-slot)
181
 
  (add-blank-slot)
182
 
  (add-normal-slot '())
183
 
  (add-normal-slot '())
 
177
  (add-normal-slot '() 'tableau)
 
178
  (add-normal-slot '() 'tableau)
 
179
  (add-blank-slot)
 
180
  (add-blank-slot)
 
181
  (add-normal-slot '() 'tableau)
 
182
  (add-normal-slot '() 'tableau)
184
183
  (set! VERTPOS (+ VERTPOS 0.5))
185
 
  (add-normal-slot '())
186
 
  (add-normal-slot DECK)
 
184
  (add-normal-slot '() 'waste)
 
185
  (add-normal-slot DECK 'stock)
187
186
  (set! VERTPOS (- VERTPOS 0.5))
188
 
  (add-normal-slot '())
189
 
  (add-normal-slot '())
190
 
  (add-carriage-return-slot)
191
 
 
192
 
  (add-normal-slot '())
193
 
  (add-normal-slot '())
194
 
  (add-blank-slot)
195
 
  (add-blank-slot)
196
 
  (add-normal-slot '())
197
 
  (add-normal-slot '())
198
 
  (add-blank-slot)
199
 
  (add-blank-slot)
200
 
  (add-normal-slot '())
201
 
  (add-normal-slot '())
202
 
  (add-carriage-return-slot)
203
 
 
204
 
  (get-and-increment-position-half)
205
 
  (add-normal-slot '())
206
 
  (add-blank-slot)
207
 
  (add-blank-slot)
208
 
  (add-blank-slot)
209
 
  (add-normal-slot '())
210
 
  (get-and-increment-position-half)
211
 
  (add-blank-slot)
212
 
  (add-blank-slot)
213
 
  (add-normal-slot '())
214
 
  (add-normal-slot '())
 
187
  (add-normal-slot '() 'foundation)
 
188
  (add-normal-slot '() 'foundation)
 
189
  (add-carriage-return-slot)
 
190
 
 
191
  (add-normal-slot '() 'tableau)
 
192
  (add-normal-slot '() 'tableau)
 
193
  (add-blank-slot)
 
194
  (add-blank-slot)
 
195
  (add-normal-slot '() 'tableau)
 
196
  (add-normal-slot '() 'tableau)
 
197
  (add-blank-slot)
 
198
  (add-blank-slot)
 
199
  (add-normal-slot '() 'foundation)
 
200
  (add-normal-slot '() 'foundation)
 
201
  (add-carriage-return-slot)
 
202
 
 
203
  (get-and-increment-position-half)
 
204
  (add-normal-slot '() 'edge)
 
205
  (add-blank-slot)
 
206
  (add-blank-slot)
 
207
  (add-blank-slot)
 
208
  (add-normal-slot '() 'edge)
 
209
  (get-and-increment-position-half)
 
210
  (add-blank-slot)
 
211
  (add-blank-slot)
 
212
  (add-normal-slot '() 'foundation)
 
213
  (add-normal-slot '() 'foundation)
215
214
  (add-carriage-return-slot)
216
215
 
217
216
  (deal-cards-face-up deck '(0
354
353
                       '(3 4 11 12 17 18 21 22))
355
354
      (deal-possible?)
356
355
      (if (find-valid-move stock '(0 2 5 6 7 8 13 14 15 16 19 20))
357
 
          (list 0 (format #f (_"Move ~a from the stock to an empty edge or tableau slot") 
358
 
                  (get-name (get-top-card stock))))
 
356
          (hint-move stock 1 (find-valid-move stock '(0 2 5 6 7 8 13 14 15 16 19 20)))
359
357
          #f)))
360
358
 
361
359
(define (game-cont)