#Play colossal cave adventure map code
I kept staring at the code at the point of failure, When the execution of the above code snippet was far in the past. So the walkthrough would not fail until much later, Their consequences were not immediately visible to the player. The worse part was that these random room decisions were hidden. Would indeed return a stable value like, say, 3,īut iterating across locations would yield a different Finally, Python object memory address are not stableįrom one run of the interpreter to the next,Įven if you are running exactly the same sequence of operations!.Python sets must hash and store them by their memory addresses. When faced with quite generic objects like my Room instances,.Sets, by definition, they have no inherent ordering.That, when combined together, make trouble:Ĭhoice() selects an integer 0 ≤ n < len(s)Īnd iterates over n items to find item number n. So each walkthrough starts with something like: Will not interfere with each other's stream of random numbers.
#Play colossal cave adventure map generator
I even abandoned the global random number generator In case anyone runs my tests in parallel, Making the sequence of pseudo-random numbers Standard Library module is different every time you run Python. That involved chance, my tests started breaking,
That starts the game and plays to completion.Īs soon as I started implementing game elements Since the game is playable at the Python prompt,Įach walkthrough is simply a long docfile You can find them in the package's tests directory. The main tests for the game are two large walkthroughs. “ Somewhere Nearby is Colossal Cave: Examining Will Crowther's Original ‘Adventure’ in Code and in Kentucky”įrom the Summer 2007 issue of the Digital Humanities Quarterly. I recommend Dennis G. Jerz's admirably thorough paper If you want to know more about the history of the original game itself, Who rustle in the darkness beyond the light of your lamp In a quest that eventually involves danger, magic,Īnd even encounters with a few computer-controlled characters, “Adventure” invites you to start collecting treasures from the cave Of the Flint-Mammoth cave system in Kentucky Which can, mercifully, be typed as abbreviations The player directs the game with simple one- and two-word commands To offer players a virtual world to explore at their own pace, That I announced more than a year ago during the final round of Of the original Colossal Cave Adventure game