Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[bin/crypt] allow 'look' from the command loop

  • Loading branch information...
commit 2efa9e7e9b6a61e994ea7cdbba8dfbc99f55b053 1 parent c848fd4
@masak authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 bin/crypt
View
14 bin/crypt
@@ -249,6 +249,8 @@ multi MAIN() {
say "to find out...";
say "";
+ my $game = Crypt::Game.new();
+
loop {
my $command = prompt('> ');
given $command {
@@ -257,6 +259,18 @@ multi MAIN() {
last;
}
+ $command .= lc;
+ $command .= trim;
+
+ when 'look' {
+ my @events = $game.look();
+ for @events {
+ when Crypt::PlayerLooked {
+ say "<{.description_of}>";
+ }
+ }
+ }
+
default {
say "Sorry, I did not understand that.";
}
Please sign in to comment.
Something went wrong with that request. Please try again.