Skip to content

Commit

Permalink
[bin/crypt] implement simple game loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Masak committed Jul 3, 2012
1 parent b80e96e commit 247f52c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions bin/crypt
Expand Up @@ -228,6 +228,32 @@ class Hanoi::Game {
}
}

multi MAIN() {
say "CRYPT";
say "=====";
say "";

say "You've heard there's supposed to be an ancient hidden crypt in these";
say "woods. One containing a priceless treasure. Well, there's only one way";
say "to find out...";
say "";

loop {
my $command = prompt('> ');
given $command {
when !.defined || .lc eq "q" | "quit" {
say "";
last;
}

default {
say "Sorry, I did not understand that.";
}
}
say "";
}
}

multi MAIN('hanoi') {
my Hanoi::Game $game .= new;
my @disks = <tiny small medium large huge> X~ ' disk';
Expand Down

0 comments on commit 247f52c

Please sign in to comment.