RCRPG/Raku: Difference between revisions

m
→‎RCRPG/Raku: Fix syntax highlighting
m (→‎{{header|Perl 6}}: GLR updates, edited works with)
m (→‎RCRPG/Raku: Fix syntax highlighting)
 
(4 intermediate revisions by the same user not shown)
Line 1:
{{collection|RCRPG}}
=={{example|task=RCRPG|language=Raku}}==
 
This [[Perl 6Raku]] version of [[RCRPG]] implements a text interface.
 
==Language Idioms==
This version of RCRPG demonstrates the following idioms in Perl 6Raku.
* A simple [[input loop]]
* Subroutines (Functions)
Line 23:
As with the [[RCRPG/Perl|Perl version]].
==Code==
{{works with|Rakudo|20152018.0903}}
<syntaxhighlight lang="raku" perl6line>my %commands;
my %rooms;
 
Line 67:
} else {
say "There are exits: {@$.links.join(', ')\
.subst(/','(<-[,]>+)$/, -> $/ {" and$0"})}.";
}
if $.stuff {
Line 235:
}
%rooms{$room}.greet;
}</syntaxhighlight >
}</lang>
10,327

edits