Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[bin/crypt] finally recognize 'take tiny disk'

Use the same munging as in the hanoi game.
It's a hack, but it gets the job done.
  • Loading branch information...
commit ecdc8a1383fce9e6d9d03b85af743b8dc3ae3864 1 parent 8d2d808
Carl Mäsak authored July 29, 2012

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. 6  bin/crypt
6  bin/crypt
@@ -1548,8 +1548,10 @@ inventory";
1548 1548
                 proceed;
1549 1549
             }
1550 1550
 
1551  
-            my $verb = $command.words[0];
1552  
-            my @args = $command.words[1..*];
  1551
+            sub munge   { $^s.subst(/' disk'»/, '_disk', :g) }
  1552
+            sub unmunge { $^s.subst(/'_disk'»/, ' disk', :g) }
  1553
+            my $verb = .&munge.words[0].&unmunge;
  1554
+            my @args = .&munge.words[1..*]».&unmunge;
1553 1555
             when %commands.exists($verb) {
1554 1556
                 my @req_args = %commands{$verb}.list;
1555 1557
                 when @args != @req_args {

0 notes on commit ecdc8a1

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