Hunt the Wumpus/Raku: Difference between revisions

m
Thundergnat moved page Hunt The Wumpus/Raku to Hunt the Wumpus/Raku: capitaliztion match
m (→‎{{header|Perl 6}}: fix broken link)
m (Thundergnat moved page Hunt The Wumpus/Raku to Hunt the Wumpus/Raku: capitaliztion match)
 
(5 intermediate revisions by 2 users not shown)
Line 1:
{{collection|Hunt_The_Wumpus}}
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)]. The text, prompts and game play are very close the the original. 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. 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.
=={{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" perl6line>#Based on code from http://www.atariarchives.org/bcc1/showpage.php?page=247 copyright Gregory Yob
 
my $intro = q:to/END/;
Line 210 ⟶ 216:
%loc{<YOU WUMPUS PIT1 PIT2 BAT1 BAT2>} = (1..20).pick(*);
%loc;
}</langsyntaxhighlight>
Sample Output:
<pre>INSTRUCTIONS (Y-N) N
10,327

edits