Dear Monks,

Since I started using computers, many years ago, I've always been fascinated with the idea of writing my own games.

The problem is that I didn't have a team to help me with fancy images and sounds; so I started writing simple text adventures, and have done so in most languages I have learnt so far.

This meditation is about the writing of an adventure in Perl 6.

According to the Wikipedia, interactive fiction (which is another name for "adventure") describes software simulating environments in which players use text commands to control characters and influence the environment. Works in this form can be understood as literary narratives and as computer games. In common usage, the word refers to text adventures, a type of adventure game with text-based input and output.

A typical adventure session could go like this (an extract from the classic Colossal Cave):

You are standing at the end of a road before a small brick building. Around you is a forest. A small stream flows out of the building and down a gully. > SOUTH You are in a valley in the forest beside a stream tumbling along a rocky bed. > SOUTH At your feet all the water of the stream splashes into a 2-inch slit in the rock. Downstream the streambed is bare rock. > DRINK WATER You have taken a drink from the stream. The water tastes strongly of minerals, but is not unpleasant. It is extremely cold.

One of the interesting things of writing adventures, is that they require some knowledge of a programming language, but are not that difficult to write (once you know a few basic concepts); and since creating is actually as fun as playing, it's an interesting way to learn a new language.

So I decided I would test my knowledge against the current implementations of Perl 6, and the result was this presentation to the Nordic Perl Workshop (and a couple of days later for the guys of Oslo.pm).

I hope you'll enjoy!


In reply to Adventures in Perl 6 by nferraz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.