gavin100 has asked for the wisdom of the Perl Monks concerning the following question:
Hi, can someone please help me with the code below and how to use curly brackets. Thank you for your time
#! usr/bin/perl -w $im_thinking=int(rand 10); print "Pick a number"; $guess=<STDIN>; chomp $guess; while($guess != $im_thinking) if($guess>$im_thinking) print "You guessed too high!\n"; elsif($guess < $im_thinking) print "You guessed too low!\n"; else print "You got it right!\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with While Loop
by choroba (Cardinal) on Sep 14, 2015 at 11:37 UTC | |
by AnomalousMonk (Archbishop) on Sep 14, 2015 at 19:15 UTC | |
by gavin100 (Initiate) on Sep 14, 2015 at 12:46 UTC | |
|
Re: Please help
by Corion (Patriarch) on Sep 14, 2015 at 11:31 UTC | |
by gavin100 (Initiate) on Sep 14, 2015 at 12:48 UTC | |
|
Re: Help with While Loop
by locked_user sundialsvc4 (Abbot) on Sep 14, 2015 at 16:33 UTC |