Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[bin/crypt] present things properly in `look`

  • Loading branch information...
commit b10aab3cfbaa975a0d3fab63c0dc5c1295b111a3 1 parent 4c6b7f1
Carl Mäsak authored
Showing with 27 additions and 0 deletions.
  1. +27 −0 bin/crypt
27 bin/crypt
View
@@ -910,6 +910,7 @@ multi MAIN() {
say .ucfirst;
say "";
say %descriptions{$_};
+ say "There is a car here.";
say "You can go east.";
say "";
}
@@ -949,6 +950,19 @@ multi MAIN() {
say ucfirst .room;
say "";
say %descriptions{.room};
+ for .things -> $thing {
+ if $thing ~~ Pair {
+ say "There is a $thing.key() here.";
+ # XXX: Needs to work for nested calls, too
+ say "The $thing.key() contains:";
+ for $thing.value.list -> $containee {
+ say " A $containee.";
+ }
+ }
+ else {
+ say "There is a $thing here.";
+ }
+ }
if .exits {
say "You can go {join ' and ', .exits}.";
}
@@ -976,6 +990,19 @@ multi MAIN() {
when Adventure::PlayerWalked { say ucfirst .to; say "" }
when Adventure::PlayerLooked {
say %descriptions{.room};
+ for .things -> $thing {
+ if $thing ~~ Pair {
+ say "There is a $thing.key() here.";
+ # XXX: Needs to work for nested calls, too
+ say "The $thing.key() contains:";
+ for $thing.value.list -> $containee {
+ say " A $containee.";
+ }
+ }
+ else {
+ say "There is a $thing here.";
+ }
+ }
if .exits {
say "You can go {join ' and ', .exits}.";
}
Please sign in to comment.
Something went wrong with that request. Please try again.