Debian Codegraph @

PKG-INFO

raw
1 Metadata-Version: 1.1
2 Name: adventure
3 Version: 1.6
4 Summary: Colossal Cave adventure game at the Python prompt
5 Home-page: https://github.com/brandon-rhodes/python-adventure
6 Author: Brandon Craig Rhodes
7 Author-email: [email protected]
8 License: UNKNOWN
9 Description: This is a faithful port of the “Adventure” game to Python 3 from the
10 original 1977 FORTRAN code by Crowther and Woods (it is driven by the
11 same ``advent.dat`` file!) that lets you explore Colossal Cave, where
12 others have found fortunes in treasure and gold, though it is rumored
13 that some who enter are never seen again.
14
15 This page:
16
17 http://rickadams.org/adventure/e_downloads.html
18
19 offers the original PHP source code at this link:
20
21 http://www.ifarchive.org/if-archive/games/source/advent-original.tar.gz
22
23 To encourage the use of Python 3, the game is designed to be played
24 right at the Python prompt. Single-word commands can be typed by
25 themselves, but two-word commands should be written as a function call
26 (since a two-word command would not be valid Python)::
27
28 >>> import adventure
29 >>> adventure.play()
30 WELCOME TO ADVENTURE!! WOULD YOU LIKE INSTRUCTIONS?
31
32 >>> no
33 YOU ARE STANDING AT THE END OF A ROAD BEFORE A SMALL BRICK BUILDING.
34 AROUND YOU IS A FOREST. A SMALL STREAM FLOWS OUT OF THE BUILDING AND
35 DOWN A GULLY.
36
37 >>> east
38 YOU ARE INSIDE A BUILDING, A WELL HOUSE FOR A LARGE SPRING.
39 THERE ARE SOME KEYS ON THE GROUND HERE.
40 THERE IS A SHINY BRASS LAMP NEARBY.
41 THERE IS FOOD HERE.
42 THERE IS A BOTTLE OF WATER HERE.
43
44 >>> get(lamp)
45 OK
46
47 >>> leave
48 YOU'RE AT END OF ROAD AGAIN.
49
50 >>> south
51 YOU ARE IN A VALLEY IN THE FOREST BESIDE A STREAM TUMBLING ALONG A
52 ROCKY BED.
53
54 The original Adventure paid attention to only the first five letters of
55 each command, so a long command like ``inventory`` could simply be typed
56 as ``inven``. This package defines a symbol for both versions of every
57 long word, so you can type the long or short version as you please.
58
59 You can save your game at any time by calling the ``save()`` command
60 with a filename, and then can resume it later::
61
62 >>> save('advent.save')
63 GAME SAVED
64
65 >>> adventure.resume('advent.save')
66 GAME RESTORED
67 >>> look
68 SORRY, BUT I AM NOT ALLOWED TO GIVE MORE DETAIL. I WILL REPEAT THE
69 LONG DESCRIPTION OF YOUR LOCATION.
70 YOU ARE IN A VALLEY IN THE FOREST BESIDE A STREAM TUMBLING ALONG A
71 ROCKY BED.
72
73 You can find two complete, working walkthroughs of the game in its
74 ``tests`` directory, which you can run using the ``discover`` module that
75 comes built-in with Python 3::
76
77 $ python3 -m unittest discover adventure
78
79 I wrote most of this package over Christmas vacation 2010, to learn more
80 about the workings of the game that so enthralled me as a child; the
81 project also gave me practice writing Python 3. I still forget the
82 parentheses when writing ``print()`` if I am not paying attention.
83
84 Traditional Mode
85 ================
86
87 You can also use this package to play Adventure at a traditional prompt
88 that does not require its input to be valid Python. Use your operating
89 system command line to run the package::
90
91 $ python3 -m adventure
92 WELCOME TO ADVENTURE!! WOULD YOU LIKE INSTRUCTIONS?
93
94 >
95
96 At the prompt that will appear, two-word commands can simply be
97 separated by a space::
98
99 > get lamp
100 OK
101
102 For extra authenticity, the output of the Adventure game in this mode is
103 typed to your screen at 1200 baud. You will note that although this
104 prints the text faster than you can read it anyway, your experience of
105 the game will improve considerably, especially when a move results in a
106 surprise.
107
108 Why is the game better at 1200 baud? When a paragraph of text is
109 allowed to appear on the screen all at once, your eyes scan the entire
110 paragraph for important information, often ruining any surprises before
111 you can then settle down and read it from the beginning. But at 1200
112 baud, you wind up reading the text in order as it appears, which unfolds
113 the narrative sequentially as the author of Adventure intended.
114
115 If you created a file with the in-game ``save`` command, you can restore
116 it later by naming it on the command line::
117
118 > save mygame
119 GAME SAVED
120 > quit
121 DO YOU REALLY WANT TO QUIT NOW?
122 > y
123 OK
124
125 $ python3 -m adventure mygame
126 GAME RESTORED
127 >
128
129 Notes
130 =====
131
132 * Several Adventure commands conflict with standard Python built-in
133 functions. If you want to run the normal Python function ``exit()``,
134 ``open()``, ``quit()``, or ``help()``, then import the ``builtin``
135 module and run the copy of the function stored there.
136
137 * The word “break” is a Python keyword, so there was no possibility of
138 using it in the game. Instead, use one of the two synonyms defined by
139 the PDP version of Adventure: “shatter” or “smash.”
140
141 Copyright
142 =========
143
144 The ``advent.dat`` game data file distributed with this Python package,
145 like the rest of the original source code for Adventure, is a public
146 domain work. Phrases from the original work that have been copied into
147 my source code from the FORTRAN source (the famous phrase “You have
148 gotten yourself killed” and so forth) remain public domain and can be
149 used without attribution.
150
151 My own Python code that re-implements the game engine is:
152
153 Copyright 2010–2015 Brandon Rhodes
154
155 Licensed under the Apache License, Version 2.0 (the "License");
156 you may not use this file except in compliance with the License.
157 You may obtain a copy of the License at
158
159 http://www.apache.org/licenses/LICENSE-2.0
160
161 Unless required by applicable law or agreed to in writing, software
162 distributed under the License is distributed on an "AS IS" BASIS,
163 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
164 See the License for the specific language governing permissions and
165 limitations under the License.
166
167 Changelog
168 =========
169
170 | 1.6 — 2020 August 15 — add support for upper-case commands typed at the terminal; and fix exception if user dies with water in their bottle `(see #26) <https://github.com/brandon-rhodes/python-adventure/issues/26>`_.
171 | 1.5 — 2020 July 18 — fix for fatal exception when “lamp turn” is entered.
172 | 1.4 — 2016 January 31 — readline editing; added license; bug fix; test fix.
173 | 1.3 — 2012 April 27 — installs on Windows; fixed undefined commands
174 | 1.2 — 2012 April 5 — restoring saves from command line; 5-letter commands
175 | 1.1 — 2011 March 12 — traditional mode; more flexible Python syntax
176 | 1.0 — 2011 February 15 — 100% test coverage, feature-complete
177 | 0.3 — 2011 January 31 — first public release
178
179 Platform: UNKNOWN
180 Classifier: Development Status :: 6 - Mature
181 Classifier: Environment :: Console
182 Classifier: Intended Audience :: End Users/Desktop
183 Classifier: License :: OSI Approved :: Apache Software License
184 Classifier: Programming Language :: Python :: 3
185 Classifier: Programming Language :: Python :: 3.2
186 Classifier: Topic :: Games/Entertainment