home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / gnome-games / aisleriot / games / athena.scm < prev    next >
Encoding:
Text File  |  2009-04-14  |  2.4 KB  |  86 lines

  1. ;; AisleRiot - athena.scm  -*-scheme-*- 
  2. ;; Copyright (C) Alan Horkan, 2005.  
  3. ;; based on klondike.scm
  4. ; Copyright (C) 1998, 2003 Jonathan Blandford <jrb@mit.edu>
  5. ;
  6. ; This game is free software; you can redistribute it and/or modify
  7. ; it under the terms of the GNU General Public License as published by
  8. ; the Free Software Foundation; either version 2, or (at your option)
  9. ; any later version.
  10. ;
  11. ; This program is distributed in the hope that it will be useful,
  12. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. ; GNU General Public License for more details.
  15. ;
  16. ; You should have received a copy of the GNU General Public License
  17. ; along with this program; if not, write to the Free Software
  18. ; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  19. ; USA
  20.  
  21. ;; Athena differs from Klondike only in the intial layout
  22. ;; including 1 or 3 card deal, and any other options like ...
  23. ;; Optional "King Only" enabled by default [TODO]
  24. ;; TODO rewrite in a way less redundant way and share code with Klondike
  25. ;; As seen in Pretty Good Solitaire 10  http://goodsol.com  2005.  
  26.  
  27. (load "klondike.scm")
  28.  
  29. (define deal-one #t)
  30. (define deal-three #f)
  31. (define no-redeal #f)
  32.  
  33. (define max-redeal 2)
  34.  
  35. ; The set up:
  36.  
  37. (define tableau '(6 7 8 9 10 11 12))
  38. (define foundation '(2 3 4 5))
  39. (define stock 0)
  40. (define waste 1)
  41.  
  42. (define (new-game)
  43.   (initialize-playing-area)
  44.   (set-ace-low)
  45.  
  46.   (make-standard-deck)
  47.   (shuffle-deck)
  48.   
  49.   (add-normal-slot DECK)
  50.  
  51.   (if deal-three
  52.       (add-partially-extended-slot '() right 3)
  53.       (add-normal-slot '()))
  54.  
  55.   (add-blank-slot)
  56.   (add-normal-slot '())
  57.   (add-normal-slot '())
  58.   (add-normal-slot '())
  59.   (add-normal-slot '())
  60.   (add-carriage-return-slot)
  61.   (add-extended-slot '() down)
  62.   (add-extended-slot '() down)
  63.   (add-extended-slot '() down)
  64.   (add-extended-slot '() down)
  65.   (add-extended-slot '() down)
  66.   (add-extended-slot '() down)
  67.   (add-extended-slot '() down)
  68.  
  69.   (deal-cards stock tableau) 
  70.   (deal-cards-face-up stock tableau) 
  71.   (deal-cards stock tableau) 
  72.   (deal-cards-face-up stock tableau) 
  73.  
  74.   (give-status-message)
  75.  
  76.   (list 7 3)
  77. )
  78.  
  79. (define (get-options)
  80.   (list (list (_"Three card deals") deal-three)))
  81.  
  82. (define (apply-options options)
  83.   (set! deal-three (cadar options)))
  84.  
  85. (set-lambda new-game button-pressed button-released button-clicked button-double-clicked game-over game-won get-hint get-options apply-options timeout droppable? dealable?)
  86.