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

« back to all changes in this revision

Viewing changes to games/eight-off.scm

  • Committer: Package Import Robot
  • Author(s): Emilio Pozuelo Monfort, Jeremy Bicha, Robert Ancell, Rico Tzschichholz, Emilio Pozuelo Monfort
  • Date: 2013-05-25 19:56:23 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130525195623-im6ppfonxjy1jarp
Tags: 1:3.8.0-1
[ Jeremy Bicha ]
* New upstream release.
* debian/control.in:
  - Build-depend on desktop-file-utils
  - Recommend yelp
  - Remove obsolete libgstreamer build-depends 

[ Robert Ancell ]
* debian/aisleriot.install:
* debian/aisleriot.menu:
* debian/patches/02_desktop-path.patch:
* debian/pixmaps/freecell.xpm:
  - Updated as freecell.desktop is removed

[ Rico Tzschichholz ]
* debian/control.in: Bump Build-Deps on libgtk-3-dev (>= 3.4.0),
  libglib2.0-dev (>= 2.32.0)

[ Emilio Pozuelo Monfort ]
* debian/watch:
  + Fixed, it wasn't tracking new versions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
(def-save-var free-reserves 0)
20
20
 
 
21
(define foundation '(0 1 2 3))
 
22
(define reserve '(4 5 6 7 8 9 10 11))
 
23
(define tableau '(12 13 14 15 16 17 18 19))
 
24
 
21
25
(define (new-game)
22
26
  (initialize-playing-area)
23
27
  (set-ace-low)
24
28
  (make-standard-deck)
25
29
  (shuffle-deck)
26
30
 
27
 
  (add-normal-slot DECK)
28
 
  (add-carriage-return-slot)
29
 
  (add-normal-slot '())
30
 
  (add-carriage-return-slot)
31
 
  (add-normal-slot '())
32
 
  (add-carriage-return-slot)
33
 
  (add-normal-slot '())
 
31
  (add-normal-slot DECK 'foundation)
 
32
  (add-carriage-return-slot)
 
33
  (add-normal-slot '() 'foundation)
 
34
  (add-carriage-return-slot)
 
35
  (add-normal-slot '() 'foundation)
 
36
  (add-carriage-return-slot)
 
37
  (add-normal-slot '() 'foundation)
34
38
 
35
39
 
36
40
  (set! VERTPOS 0)
37
41
 
38
42
  (add-blank-slot)
39
 
  (add-normal-slot '())
40
 
  (add-normal-slot '())
41
 
  (add-normal-slot '())
42
 
  (add-normal-slot '())
43
 
  (add-normal-slot '())
44
 
  (add-normal-slot '())
45
 
  (add-normal-slot '())
46
 
  (add-normal-slot '())
 
43
  (add-normal-slot '() 'reserve)
 
44
  (add-normal-slot '() 'reserve)
 
45
  (add-normal-slot '() 'reserve)
 
46
  (add-normal-slot '() 'reserve)
 
47
  (add-normal-slot '() 'reserve)
 
48
  (add-normal-slot '() 'reserve)
 
49
  (add-normal-slot '() 'reserve)
 
50
  (add-normal-slot '() 'reserve)
47
51
 
48
52
  (add-carriage-return-slot)
49
53
 
50
54
  (add-blank-slot)
51
55
  (add-blank-slot)
52
56
 
53
 
  (add-extended-slot '() down)
54
 
  (add-extended-slot '() down)
55
 
  (add-extended-slot '() down)
56
 
  (add-extended-slot '() down)
57
 
  (add-extended-slot '() down)
58
 
  (add-extended-slot '() down)
59
 
  (add-extended-slot '() down)
60
 
  (add-extended-slot '() down)
 
57
  (add-extended-slot '() down 'tableau)
 
58
  (add-extended-slot '() down 'tableau)
 
59
  (add-extended-slot '() down 'tableau)
 
60
  (add-extended-slot '() down 'tableau)
 
61
  (add-extended-slot '() down 'tableau)
 
62
  (add-extended-slot '() down 'tableau)
 
63
  (add-extended-slot '() down 'tableau)
 
64
  (add-extended-slot '() down 'tableau)
61
65
 
62
66
  (deal-cards-face-up 0 '(12 13 14 15 16 17 18 19 12 13 14 15 16 17 18
63
67
                             19 12 13 14 15 16 17 18 19 12 13 14 15 16
177
181
             (= f-slot 4))
178
182
         (check-to-foundations? (+ 1 slot) 0))
179
183
        ((= (get-value (get-top-card slot)) ace)
180
 
         (list 2 (get-name (get-top-card slot)) (_"an empty foundation")))
 
184
         (hint-move slot 1 (find-empty-slot foundation)))
181
185
        ((and (not (empty-slot? f-slot))
182
186
              (= (get-suit (get-top-card slot))
183
187
                 (get-suit (get-top-card f-slot)))
184
188
              (= (get-value (get-top-card slot))
185
189
                 (+ 1 (get-value (get-top-card f-slot)))))
186
 
         (list 1 (get-name (get-top-card slot)) (get-name (get-top-card f-slot))))
 
190
         (hint-move slot 1 f-slot))
187
191
        (#t (check-to-foundations? slot (+ 1 f-slot)))))
188
192
 
189
193
(define (check-for-king card-list iter slot)
193
197
              (> slot 11))
194
198
         #f)
195
199
        ((= (get-value (car card-list)) king)
196
 
         (get-name (car card-list)))
 
200
         #t)
197
201
        ((= iter 0)
198
202
         #f)
199
203
        ((and (> (length card-list)1)
228
232
        ((and (not (= slot t-slot))
229
233
              (empty-slot? t-slot)
230
234
              (check-for-king (get-cards slot) free-reserves slot))
231
 
         (list 2 
232
 
               (check-for-king (get-cards slot) free-reserves slot) 
233
 
               (_"an empty tableau")))
 
235
         (hint-move slot (- 14 (get-value (get-top-card slot))) t-slot))
234
236
        ((and (not (= slot t-slot))
235
237
              (not (empty-slot? t-slot))
236
238
              (= (get-suit (get-top-card slot))
238
240
              (check-for-spec-card (get-cards slot) 
239
241
                                   free-reserves 
240
242
                                   (- (get-value (get-top-card t-slot)) 1)))
241
 
         (list 1 
242
 
               (get-name (make-card (- (get-value (get-top-card t-slot)) 1)
243
 
                                    (get-suit (get-top-card t-slot))))
244
 
               (get-name (get-top-card t-slot))))
 
243
         (hint-move slot (- (get-value (get-top-card t-slot)) (get-value (get-top-card slot))) t-slot))
245
244
        (#t (check-to-tableau? slot (+ 1 t-slot)))))
246
245
 
247
246
(define (check-for-empty-reserve)