Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[bin/crypt] implement simple game loop

  • Loading branch information...
commit 247f52c0bc26534d372b4211050f146bc739cdef 1 parent b80e96e
@masak authored
Showing with 26 additions and 0 deletions.
  1. +26 −0 bin/crypt
View
26 bin/crypt
@@ -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';
Please sign in to comment.
Something went wrong with that request. Please try again.