Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[bin/crypt] abbreviated directions

  • Loading branch information...
commit 8325b8e6b8fddeff21b0d8059c13d81e30b9490c 1 parent dc32819
Carl Mäsak authored July 28, 2012

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

  1. 18  bin/crypt
18  bin/crypt
@@ -1374,6 +1374,19 @@ multi MAIN() {
1374 1374
         up down in out
1375 1375
     >;
1376 1376
 
  1377
+    my %abbr_directions = <
  1378
+        n  north
  1379
+        s  south
  1380
+        e  east
  1381
+        w  west
  1382
+        ne northeast
  1383
+        nw northwest
  1384
+        se southeast
  1385
+        sw southwest
  1386
+        u  up
  1387
+        d  down
  1388
+    >;
  1389
+
1377 1390
     given 'clearing' {
1378 1391
         say .ucfirst;
1379 1392
         say "";
@@ -1448,6 +1461,11 @@ open bag                     | close bag";
1448 1461
                 }
1449 1462
             }
1450 1463
 
  1464
+            when /^ [''|go \h+|walk \h+] (\w+) <?{ %abbr_directions{$0} }> $/ {
  1465
+                $command = "walk %abbr_directions{$0}";
  1466
+                proceed;
  1467
+            }
  1468
+
1451 1469
             when any @possible_directions {
1452 1470
                 $command = "walk $command";
1453 1471
                 proceed;

0 notes on commit 8325b8e

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