Permalink
Browse files

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

  • Loading branch information...
1 parent c848fd4 commit 2efa9e7e9b6a61e994ea7cdbba8dfbc99f55b053 @masak committed Jul 3, 2012
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.";
}

0 comments on commit 2efa9e7

Please sign in to comment.