Commit b9aa9894 authored by Rosanna Yuen's avatar Rosanna Yuen Committed by Rosanna Yuen

added a new game added a new game added a new help file added a new help


Thu Mar  8 19:08:45 2001  Rosanna Yuen  <zana@webwynk.net>

	* fortress.scm: added a new game
	* streets_and_alleys.scm: added a new game
	* docs/C/fortress.sgml: added a new help file
	* docs/C/streets_and_alleys.sgml: added a new help file
parent f4950c50
Thu Mar 8 19:08:45 2001 Rosanna Yuen <zana@webwynk.net>
* fortress.scm: added a new game
* streets_and_alleys.scm: added a new game
Thu Mar 8 12:20:44 2001 Jonathan Blandford <jrb@redhat.com>
* sol.c (new_game): minor fixup.
......
......@@ -62,6 +62,7 @@ types_DATA = \
elevator.scm \
escalator.scm \
first_law.scm \
fortress.scm \
fortunes.scm \
fourteen.scm \
freecell.scm \
......@@ -97,6 +98,7 @@ types_DATA = \
spider.scm \
spiderette.scm \
straight_up.scm \
streets_and_alleys.scm \
thieves.scm \
thirteen.scm \
thumb_and_pouch.scm \
......
......@@ -20,6 +20,7 @@ eight-off.html
elevator.html
escalator.html
first-law.html
fortress.html
fortunes.html
fourteen.html
freecell.html
......@@ -58,6 +59,7 @@ sir-tommy.html
spider.html
spiderette.html
straight-up.html
streets-and-alleys.html
thirteen.html
thieves.html
thumb-and-pouch.html
......
Fri Mar 9 01:53:42 2001 Rosanna Yuen <zana@webwynk.net>
* fortress.sgml: added a new help file
* streets_and_alleys.sgml: added a new help file
Wed Mar 7 20:01:18 2001 Rosanna Yuen <zana@webwynk.net>
* helsinki.sgml: added a new help file
......
......@@ -32,6 +32,7 @@ help_DATA = index.html \
elevator.html \
escalator.html \
first-law.html \
fortress.html \
fortunes.html \
fourteen.html \
freecell.html \
......@@ -66,6 +67,7 @@ help_DATA = index.html \
spider.html \
spiderette.html \
straight-up.html \
streets-and-alleys.html \
thieves.html \
thirteen.html \
thumb-and-pouch.html \
......@@ -103,6 +105,7 @@ help_SGML = \
elevator.sgml \
escalator.sgml \
first_law.sgml \
fortress.sgml \
fortunes.sgml \
fourteen.sgml \
freecell.sgml \
......@@ -137,6 +140,7 @@ help_SGML = \
spider.sgml \
spiderette.sgml \
straight_up.sgml \
streets_and_alleys.sgml \
thieves.sgml \
thirteen.sgml \
thumb_and_pouch.sgml \
......
......@@ -18,6 +18,7 @@
<!ENTITY elevator SYSTEM "elevator.sgml">
<!ENTITY escalator SYSTEM "escalator.sgml">
<!ENTITY first-law SYSTEM "first_law.sgml">
<!ENTITY fortress SYSTEM "fortress.sgml">
<!ENTITY fortunes SYSTEM "fortunes.sgml">
<!ENTITY fourteen SYSTEM "fourteen.sgml">
<!ENTITY freecell SYSTEM "freecell.sgml">
......@@ -52,6 +53,7 @@
<!ENTITY spider SYSTEM "spider.sgml">
<!ENTITY spiderette SYSTEM "spiderette.sgml">
<!ENTITY straight-up SYSTEM "straight_up.sgml">
<!ENTITY streets-and-alleys SYSTEM "streets_and_alleys.sgml">
<!ENTITY thieves SYSTEM "thieves.sgml">
<!ENTITY thirteen SYSTEM "thirteen.sgml">
<!ENTITY thumb-and-pouch SYSTEM "thumb_and_pouch.sgml">
......@@ -113,6 +115,7 @@ been coded for your pleasure in the GNOME scripting language (Scheme).</para>
&elevator;
&escalator;
&first-law;
&fortress;
&fortunes;
&fourteen;
&freecell;
......@@ -147,6 +150,7 @@ been coded for your pleasure in the GNOME scripting language (Scheme).</para>
&spider;
&spiderette;
&straight-up;
&streets-and-alleys;
&thieves;
&thirteen;
&thumb-and-pouch;
......
<chapter id="fortress">
<docinfo>
<copyright>
<year>2001</year>
<holder>Rosanna Yuen</holder>
</copyright>
<author>
<firstname>Rosanna</firstname>
<surname>Yuen</surname></author>
<address><email>zana@webwynk.net</email></address>
</docinfo>
<title>Fortress</title>
<para>written by Rosanna Yuen</para>
<bridgehead>Setup</bridgehead>
<informaltable>
<tgroup cols="2">
<tbody>
<row>
<entry>Type of Deck</entry>
<entry>
Standard Deck
</entry>
</row>
<row>
<entry>Foundations</entry>
<entry>
Four piles in the middle. To be built up in suit from Ace
to King. Cards in Foundation piles are no longer in play.
</entry>
</row>
<row>
<entry>Tableau</entry>
<entry>
Five piles one each side of the Foundation. Deal five cards
face up on to each of these piles and one more on the top
two piles. The top card in any Tableau pile is available
for play.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<bridgehead>Goal</bridgehead>
<para>
Move all cards to Foundation piles.
</para>
<bridgehead>Rules</bridgehead>
<para>
Cards in Tableau piles can be built up or down in suit. Only the
top card in every pile is available for play. Empty slots can be
filled with any available card.
</para>
<para>
The Foundations are built up from Ace to King in suit. Cards in
Foundation piles are no longer in play.
</para>
<bridgehead>Options</bridgehead>
<para>None</para>
<bridgehead>Scoring</bridgehead>
<para>
Each card in Foundation piles scores one point.
</para>
<para>
Maximum possible score: 52
</para>
<bridgehead>Strategy</bridgehead>
<para>
Safeguard any empty Tableau slots you may create. They are the key
to a successful game.
</para>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
sgml-default-dtd-file: "/usr/lib/sgml/cdtd/docbook.ced"
End:
-->
<chapter id="royal-east">
<docinfo><copyright><year>1999</year><holder>Rosanna Yuen</holder></copyright>
<author><firstname>Rosanna</firstname><surname>Yuen</surname></author>
<address><email>rwsy@mit.edu</email></address></docinfo>
<title>Royal East</title>
<para>written by Rosanna Yuen</para>
<bridgehead>Setup</bridgehead>
<docinfo>
<copyright>
<year>1999</year>
<holder>Rosanna Yuen</holder>
</copyright>
<author>
<firstname>Rosanna</firstname>
<surname>Yuen</surname></author>
<address><email>zana@webwynk.net</email></address>
</docinfo>
<informaltable><tgroup cols="2"><tbody>
<row><entry>Type of Deck</entry><entry>
Standard Deck</entry></row>
<row><entry>Stock</entry><entry>
Top left pile. The rest of the deck is placed here after
dealing the Tableau. Cards are turned over one at a time to Waste. No
redeals.
</entry></row>
<row><entry>Waste</entry><entry>
To be taken from Stock. Top card available for play.
</entry></row>
<row><entry>Foundation</entry><entry>
Four corner piles of three by three grid. Deal one card on to first
Foundation pile. This card is now the base card. Build up in suit,
playing Aces on Kings as necessary.
</entry></row>
<row><entry>Tableau</entry><entry>
Deal one card face up on each of the five Tableau piles. These piles
are the ones forming a cross in the three by three grid.
</entry></row>
</tbody></tgroup></informaltable>
<title>Royal East</title>
<para>written by Rosanna Yuen</para>
<bridgehead>Setup</bridgehead>
<bridgehead>Goal</bridgehead>
<para>
Move all cards to Foundation piles.
</para>
<bridgehead>Rules</bridgehead>
<para>
Cards in Tableau are built down regardless of suit. Kings can be placed
on Aces. Cards can only be moved singly. Any available card can be
played on an empty Tableau pile.
</para>
<para>
Each Foundation pile must be started with a card the same rank as the
base card. Foundation piles are to be built up in suit from base card,
playing Aces on top of Kings if necessary. Cards in Foundation piles
are no longer in play.
</para>
<para>
Cards are flipped singly from Stock to Waste. Top card of Waste pile is
always available for play. There are no redeals.
</para>
<bridgehead>Options</bridgehead>
<para>None</para>
<bridgehead>Scoring</bridgehead>
<para>
Each card in Foundation piles scores one point.
</para>
<para>
Maximum possible score: 52
</para>
<bridgehead>Strategy</bridgehead>
<para>
Hidden treasures are wonderful things, but only if you know they are
there. Keep track of what cards are in which piles as this information
will probably come in handy.
</para>
<informaltable>
<tgroup cols="2">
<tbody>
<row>
<entry>Type of Deck</entry>
<entry>
Standard Deck
</entry>
</row>
<row>
<entry>Stock</entry>
<entry>
Top left pile. The rest of the deck is placed here after
dealing the Tableau. Cards are turned over one at a time to
Waste. No redeals.
</entry>
</row>
<row>
<entry>Waste</entry>
<entry>
To be taken from Stock. Top card available for play.
</entry>
</row>
<row>
<entry>Foundation</entry>
<entry>
Four corner piles of three by three grid. Deal one card on
to first Foundation pile. This card is now the base card.
Build up in suit, playing Aces on Kings as necessary.
</entry>
</row>
<row>
<entry>Tableau</entry>
<entry>
Deal one card face up on each of the five Tableau piles.
These piles are the ones forming a cross in the three by
three grid.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<bridgehead>Goal</bridgehead>
<para>
Move all cards to Foundation piles.
</para>
<bridgehead>Rules</bridgehead>
<para>
Cards in Tableau are built down regardless of suit. Kings can be
placed on Aces. Cards can only be moved singly. Any available card
can be played on an empty Tableau pile.
</para>
<para>
Each Foundation pile must be started with a card the same rank as
the base card. Foundation piles are to be built up in suit from
base card, playing Aces on top of Kings if necessary. Cards in
Foundation piles are no longer in play.
</para>
<para>
Cards are flipped singly from Stock to Waste. Top card of Waste
pile is always available for play. There are no redeals.
</para>
<bridgehead>Options</bridgehead>
<para>None</para>
<bridgehead>Scoring</bridgehead>
<para>
Each card in Foundation piles scores one point.
</para>
<para>
Maximum possible score: 52
</para>
<bridgehead>Strategy</bridgehead>
<para>
Hidden treasures are wonderful things, but only if you know they are
there. Keep track of what cards are in which piles as this
information will probably come in handy.
</para>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
......
<chapter id="streets-and-alleys">
<docinfo>
<copyright>
<year>2001</year>
<holder>Rosanna Yuen</holder>
</copyright>
<author>
<firstname>Rosanna</firstname>
<surname>Yuen</surname>
</author>
<address><email>zana@webwynk.net</email></address>
</docinfo>
<title>Streets and Alleys</title>
<para>written by Rosanna Yuen </para>
<bridgehead>Setup</bridgehead>
<informaltable>
<tgroup cols="2">
<tbody>
<row>
<entry>Type of Deck</entry>
<entry>
Standard Deck
</entry>
</row>
<row>
<entry>Foundation</entry>
<entry>
Four piles in the middle column. To be built from Ace to
King. Topmost card in each Foundation can be played back on
to the Tableau.
</entry>
</row>
<row>
<entry>Tableau</entry>
<entry>
Eight slots (four to the left and four to the right of
Foundations.) Deal all cards face up and extended on to
these eight piles so that there are seven cards in each pile
on the left flank and six cards in each pile on the right
flank and all cards are showing.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<bridgehead>Goal</bridgehead>
<para>
Move all cards to the Foundation piles.
</para>
<bridgehead>Rules</bridgehead>
<para>
Cards in the Tableau are built down regardless of suit. Only one
card can be moved at a time. Empty piles can be filled with any
single card.
</para>
<para>
Foundations are built up in suit.
</para>
<bridgehead>Options</bridgehead>
<para>None</para>
<bridgehead>Scoring</bridgehead>
<para>
Each card in the Foundation piles scores one point.
</para>
<para>
Maximum possible score: 52
</para>
<bridgehead>Strategy</bridgehead>
<para>
Build evenly on to Foundations if possible. Try and get an empty
Tableau slot.
</para>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
sgml-default-dtd-file: "/usr/lib/sgml/cdtd/docbook.ced"
End:
-->
; AisleRiot - fortress.scm
; Copyright (C) 2001 Rosanna Yuen <zana@webwynk.net>
;
; This game is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2, or (at your option)
; any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
; USA
(define (new-game)
(initialize-playing-area)
(set-ace-low)
(make-standard-deck)
(shuffle-deck)
(add-extended-slot '() right)
(add-blank-slot)
(add-blank-slot)
(add-blank-slot)
(add-blank-slot)
(add-blank-slot)
(add-extended-slot '() right)
(add-carriage-return-slot)
(add-extended-slot '() right)
(add-blank-slot)
(add-blank-slot)
(add-blank-slot)
(add-normal-slot DECK)
(add-blank-slot)
(add-extended-slot '() right)
(add-carriage-return-slot)
(add-extended-slot '() right)
(add-blank-slot)
(add-blank-slot)
(add-blank-slot)
(add-normal-slot '())
(add-blank-slot)
(add-extended-slot '() right)
(add-carriage-return-slot)
(add-extended-slot '() right)
(add-blank-slot)
(add-blank-slot)
(add-blank-slot)
(add-normal-slot '())
(add-blank-slot)
(add-extended-slot '() right)
(add-carriage-return-slot)
(add-extended-slot '() right)
(add-blank-slot)
(add-blank-slot)
(add-blank-slot)
(add-normal-slot '())
(add-blank-slot)
(add-extended-slot '() right)
(deal-cards-face-up 3 '(0 2 5 8 11 1 4 7 10 13 0 2 5 8 11 1 4 7 10 13 0 2 5 8 11 1 4 7 10 13 0 2 5 8 11 1 4 7 10 13 0 2 5 8 11 1 4 7 10 13 0 1))
(list 10 5))
(define (button-pressed slot-id card-list)
(and (not (empty-slot? slot-id))
(not (= slot-id 3))
(not (= slot-id 6))
(not (= slot-id 9))
(not (= slot-id 12))
(= (length card-list) 1)))
(define (button-released start-slot card-list end-slot)
(cond ((or (= end-slot 3)
(= end-slot 6)
(= end-slot 9)
(= end-slot 12))
(and (or (and (empty-slot? end-slot)
(= (get-value (car card-list)) ace))
(and (not (empty-slot? end-slot))
(= (get-suit (get-top-card end-slot))
(get-suit (car card-list)))
(= (get-value (car card-list))
(+ 1 (get-value (get-top-card end-slot))))))
(move-n-cards! start-slot end-slot card-list)
(add-to-score! 1)))
((or (empty-slot? end-slot)
(and (= (get-suit (get-top-card end-slot))
(get-suit (car card-list)))
(or (= (get-value (get-top-card end-slot))
(+ 1 (get-value (car card-list))))
(= (+ 1 (get-value (get-top-card end-slot)))
(get-value (car card-list))))))
(move-n-cards! start-slot end-slot card-list))
(#t #f)))
(define (button-clicked slot-id)
#f)
(define (move-to-foundation slot f-slot)
(cond ((= f-slot 15)
#f)
((and (empty-slot? f-slot)
(= (get-value (get-top-card slot)) ace))
(and (deal-cards slot (list f-slot))
(add-to-score! 1)))
((and (not (empty-slot? f-slot))
(= (get-suit (get-top-card f-slot))
(get-suit (get-top-card slot)))
(= (+ 1 (get-value (get-top-card f-slot)))
(get-value (get-top-card slot))))
(and (deal-cards slot (list f-slot))
(add-to-score! 1)))
(#t (move-to-foundation slot (+ 3 f-slot)))))
(define (button-double-clicked slot-id)
(and (not (empty-slot? slot-id))
(or (= slot-id 0)
(not (= (modulo slot-id 3) 0)))
(move-to-foundation slot-id 3)))
(define (game-continuable)
(and (not (game-won))
(get-hint)))
(define (game-won)
(and (empty-slot? 0)
(empty-slot? 1)
(empty-slot? 2)
(empty-slot? 4)
(empty-slot? 5)
(empty-slot? 7)
(empty-slot? 8)
(empty-slot? 10)
(empty-slot? 11)
(empty-slot? 13)))
(define (to-foundations? slot f-slot)
(cond ((= slot 14)
#f)
((or (empty-slot? slot)
(= slot 3)
(= slot 6)
(= slot 9)
(= slot 12)
(= f-slot 15))
(to-foundations? (+ 1 slot) 3))
((and (empty-slot? f-slot)
(= (get-value (get-top-card slot))
ace))
(list 2
(get-name (get-top-card slot))
"an empty Foundation"))
((and (not (empty-slot? f-slot))
(= (get-suit (get-top-card f-slot))
(get-suit (get-top-card slot)))
(= (get-value (get-top-card slot))
(+ 1 (get-value (get-top-card f-slot)))))
(list 1
(get-name (get-top-card slot))
(get-name (get-top-card f-slot))))
(#t (to-foundations? slot (+ 3 f-slot)))))
(define (to-tableau? slot1 slot2)
(cond ((= slot1 14)
#f)
((or (empty-slot? slot1)
(= slot2 14)
(= slot1 3)
(= slot1 6)
(= slot1 9)
(= slot1 12))
(to-tableau? (+ 1 slot1) (+ 2 slot1)))
((and (not (or (= slot2 3)
(= slot2 6)
(= slot2 9)
(= slot2 12)))
(not (empty-slot? slot2))
(= (get-suit (get-top-card slot1))
(get-suit (get-top-card slot2)))
(or (= (get-value (get-top-card slot1))
(+ 1 (get-value (get-top-card slot2))))
(= (get-value (get-top-card slot2))
(+ 1 (get-value (get-top-card slot1))))))
(list 1
(get-name (get-top-card slot1))
(get-name (get-top-card slot2))))
(#t
(to-tableau? slot1 (+ 1 slot2)))))
(define (empties?)
(and (or (empty-slot? 0)
(empty-slot? 1)
(empty-slot? 2)
(empty-slot? 4)
(empty-slot? 5)
(empty-slot? 7)
(empty-slot? 8)
(empty-slot? 10)
(empty-slot? 11)
(empty-slot? 13))
(list 0 "Move something into the empty Tableau slot")))
(define (get-hint)
(or (to-foundations? 0 3)
(to-tableau? 0 1)
(empties?)))
(define (get-options)
#f)
(define (apply-options options)
#f)
(define (timeout)
#f)
(set-lambda new-game button-pressed button-released button-clicked
button-double-clicked game-continuable game-won get-hint get-options
apply-options timeout)
......@@ -18,6 +18,7 @@
<!ENTITY elevator SYSTEM "elevator.sgml">
<!ENTITY escalator SYSTEM "escalator.sgml">
<!ENTITY first-law SYSTEM "first_law.sgml">
<!ENTITY fortress SYSTEM "fortress.sgml">
<!ENTITY fortunes SYSTEM "fortunes.sgml">
<!ENTITY fourteen SYSTEM "fourteen.sgml">
<!ENTITY freecell SYSTEM "freecell.sgml">
......@@ -52,6 +53,7 @@
<!ENTITY spider SYSTEM "spider.sgml">
<!ENTITY spiderette SYSTEM "spiderette.sgml">
<!ENTITY straight-up SYSTEM "straight_up.sgml">
<!ENTITY streets-and-alleys SYSTEM "streets_and_alleys.sgml">
<!ENTITY thieves SYSTEM "thieves.sgml">
<!ENTITY thirteen SYSTEM "thirteen.sgml">
<!ENTITY thumb-and-pouch SYSTEM "thumb_and_pouch.sgml">
......@@ -113,6 +115,7 @@ been coded for your pleasure in the GNOME scripting language (Scheme).</para>
&elevator;
&escalator;
&first-law;
&fortress;
&fortunes;
&fourteen;
&freecell;
......@@ -147,6 +150,7 @@ been coded for your pleasure in the GNOME scripting language (Scheme).</para>
&spider;
&spiderette;
&straight-up;
&streets-and-alleys;
&thieves;
&thirteen;
&thumb-and-pouch;
......
<chapter id="fortress">
<docinfo>
<copyright>
<year>2001</year>
<holder>Rosanna Yuen</holder>
</copyright>
<author>
<firstname>Rosanna</firstname>
<surname>Yuen</surname></author>
<address><email>zana@webwynk.net</email></address>
</docinfo>
<title>Fortress</title>
<para>written by Rosanna Yuen</para>
<bridgehead>Setup</bridgehead>
<informaltable>
<tgroup cols="2">
<tbody>
<row>
<entry>Type of Deck</entry>
<entry>
Standard Deck
</entry>
</row>
<row>
<entry>Foundations</entry>
<entry>
Four piles in the middle. To be built up in suit from Ace
to King. Cards in Foundation piles are no longer in play.
</entry>
</row>
<row>
<entry>Tableau</entry>
<entry>
Five piles one each side of the Foundation. Deal five cards
face up on to each of these piles and one more on the top
two piles. The top card in any Tableau pile is available
for play.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<bridgehead>Goal</bridgehead>
<para>
Move all cards to Foundation piles.
</para>
<bridgehead>Rules</bridgehead>
<para>
Cards in Tableau piles can be built up or down in suit. Only the
top card in every pile is available for play. Empty slots can be
filled with any available card.
</para>