#!/usr/bin/perl6
#
# Copyright Brian Ponnampalam 2020
# Author is not held responsible for any damages by this script. 
# Feel free to redistribute and modify the script.
#
#
# Author: brian2004[at] hotmail[dot] com

use strict;
say "\n\nGuess a number memorize it in your head\n\n";
say "Now multiply it by 2\n\n";
say "Now add 10 to it\n\n";
say "Now divide it by 2\n\n";
my $answer = prompt "Please enter your total? ";

my $count = 0;
if ($answer < 6) {
 say "\nYou entered an invalid answer\n";
 exit 0;
}
if ($answer >= 6) {
 for (0..$answer) {
   #say $count;
   $count = $count + 1;
 }
 say "\nYou thought of number: ", ($count-6), "\n\n";
}
