Commit 8b48f101 authored by Rosanna Yuen's avatar Rosanna Yuen Committed by Rosanna Yuen

added a new game added new help file fixed screen size problem


Tue Feb 20 19:21:12 2001  Rosanna Yuen  <zana@webwynk.net>

	* monte_carlo.scm: added a new game
	* docs/C/monte_carlo.sgml: added new help file
	* neighbor.scm: fixed screen size problem
parent 63c2f422
Tue Feb 20 19:21:12 2001 Rosanna Yuen <zana@webwynk.net>
* monte_carlo.scm: added a new game
* neighbor.scm: fixed screen size problem
Tue Feb 20 17:19:28 2001 Rosanna Yuen <zana@webwynk.net>
* thirteen.scm (new-game): fixed screen size problem (bug 3087)
......
......@@ -61,6 +61,7 @@ types_DATA = \
klondike.scm \
lady_jane.scm \
maze.scm \
monte_carlo.scm \
neighbor.scm \
odessa.scm \
osmosis.scm \
......
......@@ -25,6 +25,7 @@ kansas.html
klondike.html
lady-jane.html
maze.html
monte-carlo.html
neighbor.html
odessa.html
osmosis.html
......
Tue Feb 20 19:29:33 2001 Rosanna Yuen <zana@webwynk.net>
* monte_carlo.sgml: added new help file
Tue Feb 20 17:38:54 2001 Rosanna Yuen <zana@webwynk.net>
* glenwood.sgml: fixed the setup table
......
......@@ -18,7 +18,7 @@ help_DATA = index.html intro.html glossary.html \
freecell.html bristol.html union-square.html \
camelot-goal.png clock-rules.png docbook.css \
topic.dat straight-up.html zebra.html lady-jane.html \
maze.html glenwood.html gypsy.html
maze.html glenwood.html gypsy.html monte-carlo.html
# These are the sources:
......@@ -33,7 +33,7 @@ help_SGML = aisleriot.sgml definitions.sgml \
beleaguered_castle.sgml thirteen.sgml thieves.sgml \
freecell.sgml scorpion.sgml thumb_and_pouch.sgml \
straight_up.sgml zebra.sgml lady_jane.sgml \
maze.sgml glenwood.sgml gypsy.sgml
maze.sgml glenwood.sgml gypsy.sgml monte_carlo.sgml
EXTRA_DIST = $(help_DATA) $(help_SGML)
......
......@@ -19,6 +19,7 @@
<!ENTITY klondike SYSTEM "klondike.sgml">
<!ENTITY lady-jane SYSTEM "lady_jane.sgml">
<!ENTITY maze SYSTEM "maze.sgml">
<!ENTITY monte-carlo SYSTEM "monte_carlo.sgml">
<!ENTITY neighbor SYSTEM "neighbor.sgml">
<!ENTITY odessa SYSTEM "odessa.sgml">
<!ENTITY osmosis SYSTEM "osmosis.sgml">
......@@ -87,6 +88,7 @@ been coded for your pleasure in the GNOME scripting language (Scheme).</para>
&klondike;
&lady-jane;
&maze;
&monte-carlo;
&neighbor;
&odessa;
&osmosis;
......
<chapter id="monte-carlo">
<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>Monte Carlo</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>Stock</entry>
<entry>Top left pile. The rest of the deck is placed here after
dealing the Tableau. Cards are dealt after concatenating
the Tableau onto the empty slots.</entry>
</row>
<row>
<entry>Tableau</entry>
<entry>Five by five grid, each capable of holding one card.
One card dealt to each space at the beginning of game. Empty
spaces can be filled by moving cards from the right to the
left, from the leftmost card of the row below to the rightmost
space, and from the Stock to all otherwise empty spaces by
clicking on the Stock.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<bridgehead>Goal</bridgehead>
<para>
Remove all cards.
</para>
<bridgehead>Rules</bridgehead>
<para>
Cards can be removed in pairs that have the same value as long as
the two cards are touching horizontally, vertically, or diagonally.
</para>
<para>
At any point that there are empty piles in the Tableau, dealing from
the Stock moves all the cards already in the Tableau from the right
to left and moving them up a row to the far right if necessary
making all the empty slots at the end. The Stock is then dealt on
to these empty slots.
</para>
<bridgehead>Options</bridgehead>
<para>None</para>
<bridgehead>Scoring</bridgehead>
<para>
Each pair of cards removed scores two points.
</para>
<para>
Maximum possible score: 52
</para>
<bridgehead>Strategy</bridgehead>
<para>
Keep an eye out as to how the Tableau will shrink when you deal.
Sometimes leaving pairs in will allow more pairs to become available
after a deal.
</para>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
sgml-default-dtd-file: "/usr/lib/sgml/cdtd/docbook.ced"
End:
-->
......@@ -19,6 +19,7 @@
<!ENTITY klondike SYSTEM "klondike.sgml">
<!ENTITY lady-jane SYSTEM "lady_jane.sgml">
<!ENTITY maze SYSTEM "maze.sgml">
<!ENTITY monte-carlo SYSTEM "monte_carlo.sgml">
<!ENTITY neighbor SYSTEM "neighbor.sgml">
<!ENTITY odessa SYSTEM "odessa.sgml">
<!ENTITY osmosis SYSTEM "osmosis.sgml">
......@@ -87,6 +88,7 @@ been coded for your pleasure in the GNOME scripting language (Scheme).</para>
&klondike;
&lady-jane;
&maze;
&monte-carlo;
&neighbor;
&odessa;
&osmosis;
......
<chapter id="monte-carlo">
<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>Monte Carlo</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>Stock</entry>
<entry>Top left pile. The rest of the deck is placed here after
dealing the Tableau. Cards are dealt after concatenating
the Tableau onto the empty slots.</entry>
</row>
<row>
<entry>Tableau</entry>
<entry>Five by five grid, each capable of holding one card.
One card dealt to each space at the beginning of game. Empty
spaces can be filled by moving cards from the right to the
left, from the leftmost card of the row below to the rightmost
space, and from the Stock to all otherwise empty spaces by
clicking on the Stock.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<bridgehead>Goal</bridgehead>
<para>
Remove all cards.
</para>
<bridgehead>Rules</bridgehead>
<para>
Cards can be removed in pairs that have the same value as long as
the two cards are touching horizontally, vertically, or diagonally.
</para>
<para>
At any point that there are empty piles in the Tableau, dealing from
the Stock moves all the cards already in the Tableau from the right
to left and moving them up a row to the far right if necessary
making all the empty slots at the end. The Stock is then dealt on
to these empty slots.
</para>
<bridgehead>Options</bridgehead>
<para>None</para>
<bridgehead>Scoring</bridgehead>
<para>
Each pair of cards removed scores two points.
</para>
<para>
Maximum possible score: 52
</para>
<bridgehead>Strategy</bridgehead>
<para>
Keep an eye out as to how the Tableau will shrink when you deal.
Sometimes leaving pairs in will allow more pairs to become available
after a deal.
</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 - monte_carlo.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-normal-slot DECK)
(add-blank-slot)
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-carriage-return-slot)
(add-blank-slot)
(add-blank-slot)
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-carriage-return-slot)
(add-blank-slot)
(add-blank-slot)
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-carriage-return-slot)
(add-blank-slot)
(add-blank-slot)
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-carriage-return-slot)
(add-blank-slot)
(add-blank-slot)
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(deal-cards-face-up 0 '(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))
(give-status-message)
(list 7 5))
(define (give-status-message)
(set-statusbar-message (get-stock-no-string)))
(define (get-stock-no-string)
(string-append "Stock left: "
(number->string (length (get-cards 0)))))
(define (button-pressed slot-id card-list)
(and (> slot-id 0)
(not (empty-slot? slot-id))))
(define (adjacent? slot1 slot2)
(or (and (= slot1 (+ 6 slot2))
(not (= (modulo slot1 5) 1)))
(= slot1 (+ 5 slot2))
(and (= slot1 (+ 4 slot2))
(not (= (modulo slot1 5) 0)))
(and (= slot1 (+ 1 slot2))
(not (= (modulo slot1 5) 1)))
(and (= slot1 (- slot2 1))
(not (= (modulo slot1 5) 0)))
(and (= slot1 (- slot2 4))
(not (= (modulo slot1 5) 1)))
(= slot1 (- slot2 5))
(and (= slot1 (- slot2 6))
(not (= (modulo slot1 5) 0)))))
(define (button-released start-slot card-list end-slot)
(and (not (= start-slot end-slot))
(> end-slot 0)
(not (empty-slot? end-slot))
(adjacent? start-slot end-slot)
(= (get-value (car card-list))
(get-value (get-top-card end-slot)))
(add-to-score! 2)
(remove-card end-slot)))
(define (deal-the-empties slot)
(if (or (= slot 26)
(empty-slot? 0))
#t
(and (deal-cards-face-up 0 (list slot))
(deal-the-empties (+ 1 slot)))))
(define (moving-over slot blanks)
(cond ((= slot 26)
(deal-the-empties (- 26 blanks)))
((empty-slot? slot)
(moving-over (+ 1 slot) (+ 1 blanks)))
((> blanks 0)
(and (deal-cards slot (list (- slot blanks)))
(moving-over (+ 1 slot) blanks)))
(#t (moving-over (+ 1 slot) blanks))))
(define (move-cards-up)
(or (moving-over 1 0)
#t))
(define (button-clicked slot-id)
(and (= slot-id 0)
(move-cards-up)))
(define (button-double-clicked slot-id)
#f)
(define (game-continuable)
(give-status-message)
(and (not (game-won))
(get-hint)))
(define (game-won)
(= 52 (get-score)))
(define (horizontal-check slot-id)
(cond ((and (not (= 0 (modulo slot-id 5)))
(not (empty-slot? (+ 1 slot-id)))
(not (empty-slot? slot-id))
(= (get-value (get-top-card slot-id))
(get-value (get-top-card (+ 1 slot-id)))))
(list 1 (get-name (get-top-card slot-id))
(get-name (get-top-card (+ 1 slot-id)))))
((< slot-id 24)
(horizontal-check (+ 1 slot-id)))
(#t #f)))
(define (vertical-check slot-id)
(cond ((and (not (empty-slot? slot-id))
(not (empty-slot? (+ 5 slot-id)))
(= (get-value (get-top-card slot-id))
(get-value (get-top-card (+ 5 slot-id)))))
(list 1 (get-name (get-top-card slot-id))
(get-name (get-top-card (+ 5 slot-id)))))
((< slot-id 19)
(vertical-check (+ 1 slot-id)))
(#t #f)))
(define (backslash-check slot-id)
(cond ((and (not (= 0 (modulo slot-id 5)))
(not (empty-slot? (+ 6 slot-id)))
(not (empty-slot? slot-id))
(= (get-value (get-top-card slot-id))
(get-value (get-top-card (+ 6 slot-id)))))
(list 1 (get-name (get-top-card slot-id))
(get-name (get-top-card (+ 6 slot-id)))))
((< slot-id 18)
(backslash-check (+ 1 slot-id)))
(#t #f)))
(define (slash-check slot-id)
(cond ((and (not (= 1 (modulo slot-id 5)))
(not (empty-slot? (+ 4 slot-id)))
(not (empty-slot? slot-id))
(= (get-value (get-top-card slot-id))
(get-value (get-top-card (+ 4 slot-id)))))
(list 1 (get-name (get-top-card slot-id))
(get-name (get-top-card (+ 4 slot-id)))))
((< slot-id 19)
(slash-check (+ 1 slot-id)))
(#t #f)))
(define (empty? slot yesblank)
(cond ((= slot 26)
(if (and yesblank
(not (empty-slot? 0)))
(list 0 "Deal more cards")
#f))
((empty-slot? slot)
(empty? (+ 1 slot) #t))
(yesblank
(list 0 "Deal more cards"))
(#t (empty? (+ 1 slot) yesblank))))
(define (get-hint)
(or (horizontal-check 1)
(vertical-check 1)
(backslash-check 1)
(slash-check 2)
(empty? 1 #f)))
(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)
......@@ -66,7 +66,7 @@
(give-status-message)
(list 6 5))
(list 7 5))
(define (give-status-message)
(set-statusbar-message (get-stock-no-string)))
......
; AisleRiot - monte_carlo.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-normal-slot DECK)
(add-blank-slot)
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-carriage-return-slot)
(add-blank-slot)
(add-blank-slot)
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-carriage-return-slot)
(add-blank-slot)
(add-blank-slot)
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-carriage-return-slot)
(add-blank-slot)
(add-blank-slot)
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-carriage-return-slot)
(add-blank-slot)
(add-blank-slot)
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(add-normal-slot '())
(deal-cards-face-up 0 '(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))
(give-status-message)
(list 7 5))
(define (give-status-message)
(set-statusbar-message (get-stock-no-string)))
(define (get-stock-no-string)
(string-append "Stock left: "
(number->string (length (get-cards 0)))))
(define (button-pressed slot-id card-list)
(and (> slot-id 0)
(not (empty-slot? slot-id))))
(define (adjacent? slot1 slot2)
(or (and (= slot1 (+ 6 slot2))
(not (= (modulo slot1 5) 1)))
(= slot1 (+ 5 slot2))
(and (= slot1 (+ 4 slot2))
(not (= (modulo slot1 5) 0)))
(and (= slot1 (+ 1 slot2))
(not (= (modulo slot1 5) 1)))
(and (= slot1 (- slot2 1))
(not (= (modulo slot1 5) 0)))
(and (= slot1 (- slot2 4))
(not (= (modulo slot1 5) 1)))
(= slot1 (- slot2 5))
(and (= slot1 (- slot2 6))
(not (= (modulo slot1 5) 0)))))
(define (button-released start-slot card-list end-slot)
(and (not (= start-slot end-slot))
(> end-slot 0)
(not (empty-slot? end-slot))
(adjacent? start-slot end-slot)
(= (get-value (car card-list))
(get-value (get-top-card end-slot)))
(add-to-score! 2)
(remove-card end-slot)))
(define (deal-the-empties slot)
(if (or (= slot 26)
(empty-slot? 0))
#t
(and (deal-cards-face-up 0 (list slot))
(deal-the-empties (+ 1 slot)))))
(define (moving-over slot blanks)
(cond ((= slot 26)
(deal-the-empties (- 26 blanks)))
((empty-slot? slot)
(moving-over (+ 1 slot) (+ 1 blanks)))
((> blanks 0)
(and (deal-cards slot (list (- slot blanks)))
(moving-over (+ 1 slot) blanks)))
(#t (moving-over (+ 1 slot) blanks))))
(define (move-cards-up)
(or (moving-over 1 0)
#t))
(define (button-clicked slot-id)
(and (= slot-id 0)
(move-cards-up)))
(define (button-double-clicked slot-id)
#f)
(define (game-continuable)
(give-status-message)
(and (not (game-won))
(get-hint)))
(define (game-won)
(= 52 (get-score)))
(define (horizontal-check slot-id)
(cond ((and (not (= 0 (modulo slot-id 5)))
(not (empty-slot? (+ 1 slot-id)))
(not (empty-slot? slot-id))
(= (get-value (get-top-card slot-id))
(get-value (get-top-card (+ 1 slot-id)))))
(list 1 (get-name (get-top-card slot-id))
(get-name (get-top-card (+ 1 slot-id)))))
((< slot-id 24)
(horizontal-check (+ 1 slot-id)))
(#t #f)))
(define (vertical-check slot-id)
(cond ((and (not (empty-slot? slot-id))
(not (empty-slot? (+ 5 slot-id)))
(= (get-value (get-top-card slot-id))
(get-value (get-top-card (+ 5 slot-id)))))
(list 1 (get-name (get-top-card slot-id))
(get-name (get-top-card (+ 5 slot-id)))))
((< slot-id 19)
(vertical-check (+ 1 slot-id)))
(#t #f)))
(define (backslash-check slot-id)
(cond ((and (not (= 0 (modulo slot-id 5)))
(not (empty-slot? (+ 6 slot-id)))
(not (empty-slot? slot-id))
(= (get-value (get-top-card slot-id))
(get-value (get-top-card (+ 6 slot-id)))))
(list 1 (get-name (get-top-card slot-id))
(get-name (get-top-card (+ 6 slot-id)))))
((< slot-id 18)
(backslash-check (+ 1 slot-id)))
(#t #f)))
(define (slash-check slot-id)
(cond ((and (not (= 1 (modulo slot-id 5)))
(not (empty-slot? (+ 4 slot-id)))
(not (empty-slot? slot-id))
(= (get-value (get-top-card slot-id))
(get-value (get-top-card (+ 4 slot-id)))))
(list 1 (get-name (get-top-card slot-id))
(get-name (get-top-card (+ 4 slot-id)))))
((< slot-id 19)
(slash-check (+ 1 slot-id)))
(#t #f)))
(define (empty? slot yesblank)
(cond ((= slot 26)
(if (and yesblank
(not (empty-slot? 0)))
(list 0 "Deal more cards")
#f))
((empty-slot? slot)
(empty? (+ 1 slot) #t))
(yesblank
(list 0 "Deal more cards"))
(#t (empty? (+ 1 slot) yesblank))))
(define (get-hint)
(or (horizontal-check 1)
(vertical-check 1)
(backslash-check 1)
(slash-check 2)
(empty? 1 #f)))
(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)
......@@ -66,7 +66,7 @@
(give-status-message)
(list 6 5))
(list 7 5))
(define (give-status-message)
(set-statusbar-message (get-stock-no-string)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment