#!/home/clive/rakudo-star/bin/perl6 my $number = 100.rand.ceiling; say "I'm thinking of a number between 1 and 100 inclusive. What is it?"; for ^7 { my $guess = +prompt("Enter your guess:"); given $guess { when ! *.isa(Int) { say "Hey, that's not an integer!" } when * > $number { say "Too high!" } when * < $number { say "Too low!" } default { say "You got it!!!"; exit } } } say "Really? I was thinking of $number";