Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit b10aab3cfbaa975a0d3fab63c0dc5c1295b111a3 1 parent 4c6b7f1
Carl Mäsak authored July 18, 2012

Showing 1 changed file with 27 additions and 0 deletions. Show diff stats Hide diff stats

  1. 27  bin/crypt
27  bin/crypt
@@ -910,6 +910,7 @@ multi MAIN() {
910 910
         say .ucfirst;
911 911
         say "";
912 912
         say %descriptions{$_};
  913
+        say "There is a car here.";
913 914
         say "You can go east.";
914 915
         say "";
915 916
     }
@@ -949,6 +950,19 @@ multi MAIN() {
949 950
                         say ucfirst .room;
950 951
                         say "";
951 952
                         say %descriptions{.room};
  953
+                        for .things -> $thing {
  954
+                            if $thing ~~ Pair {
  955
+                                say "There is a $thing.key() here.";
  956
+                                # XXX: Needs to work for nested calls, too
  957
+                                say "The $thing.key() contains:";
  958
+                                for $thing.value.list -> $containee {
  959
+                                    say "  A $containee.";
  960
+                                }
  961
+                            }
  962
+                            else {
  963
+                                say "There is a $thing here.";
  964
+                            }
  965
+                        }
952 966
                         if .exits {
953 967
                             say "You can go {join ' and ', .exits}.";
954 968
                         }
@@ -976,6 +990,19 @@ multi MAIN() {
976 990
                     when Adventure::PlayerWalked { say ucfirst .to; say "" }
977 991
                     when Adventure::PlayerLooked {
978 992
                         say %descriptions{.room};
  993
+                        for .things -> $thing {
  994
+                            if $thing ~~ Pair {
  995
+                                say "There is a $thing.key() here.";
  996
+                                # XXX: Needs to work for nested calls, too
  997
+                                say "The $thing.key() contains:";
  998
+                                for $thing.value.list -> $containee {
  999
+                                    say "  A $containee.";
  1000
+                                }
  1001
+                            }
  1002
+                            else {
  1003
+                                say "There is a $thing here.";
  1004
+                            }
  1005
+                        }
979 1006
                         if .exits {
980 1007
                             say "You can go {join ' and ', .exits}.";
981 1008
                         }

0 notes on commit b10aab3

Please sign in to comment.
Something went wrong with that request. Please try again.