Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[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
@masak authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 bin/crypt
View
6 bin/crypt
@@ -1548,8 +1548,10 @@ inventory";
proceed;
}
- my $verb = $command.words[0];
- my @args = $command.words[1..*];
+ sub munge { $^s.subst(/' disk'»/, '_disk', :g) }
+ sub unmunge { $^s.subst(/'_disk'»/, ' disk', :g) }
+ my $verb = .&munge.words[0].&unmunge;
+ my @args = .&munge.words[1..*]».&unmunge;
when %commands.exists($verb) {
my @req_args = %commands{$verb}.list;
when @args != @req_args {
Please sign in to comment.
Something went wrong with that request. Please try again.