Hunt the Wumpus/Raku: Difference between revisions
m
Thundergnat moved page Hunt The Wumpus/Raku to Hunt the Wumpus/Raku: capitaliztion match
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: oops, forgot to replenish arrows on restart.) |
Thundergnat (talk | contribs) m (Thundergnat moved page Hunt The Wumpus/Raku to Hunt the Wumpus/Raku: capitaliztion match) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1:
{{collection|Hunt_The_Wumpus}}
=={{example|task=Hunt The Wumpus|language=Raku}}==
This is a fairly faithful translation of the code found in [http://www.atariarchives.org/bcc1/showpage.php?page=247 The Best of Creative Computing Volume 1 (published 1976)]. <br>
The text, prompts and game play are very close the the original. <br>
There are a few minor commands available in the main loop not in the original: Press I to re-view the instructions, Press Q to quit.
It will accept lower case as well as upper case commands. <br>
The originals instructions explicitly say hitting yourself with an arrow will cause a lose condition, the original published code does not however; this version does.
{{works with|Rakudo|2015-11-20}}
<syntaxhighlight lang="raku"
my $intro = q:to/END/;
Line 66 ⟶ 72:
( 5, 7,15), ( 6, 8,17), ( 1, 7, 9), ( 8,10,18), ( 2, 9,11),
(10,12,19), ( 3,11,13), (12,14,20), ( 4,13,15), ( 6,14,16),
(15,17,20), ( 7,16,18), ( 9,17,19), (11,18,20), (13,16,
);
Line 210 ⟶ 216:
%loc{<YOU WUMPUS PIT1 PIT2 BAT1 BAT2>} = (1..20).pick(*);
%loc;
}</
Sample Output:
<pre>INSTRUCTIONS (Y-N) N
|