XP is just a number | |
PerlMonks |
Beginner here - basic helpby xr6turbo (Initiate) |
on Mar 26, 2015 at 13:09 UTC ( [id://1121388]=perlquestion: print w/replies, xml ) | Need Help?? |
xr6turbo has asked for the wisdom of the Perl Monks concerning the following question: Hey Monks, Just starting off in perl (and programming in general) and need to do an exercise but a bit confused on the process. Trying to create a script that will ask the user to enter a number between 1 and 5 and for it to print a colour represented e.g. if they enter 1, Blue comes up or 3, red gets printed. I've done a bit of research and I know I need to create an array (@) but not too clear on how to do so. After that I need to assign an emotion to the colour e.g. blue = calm, red = angry. I'd also like to know how to incorporate modulus into this so on even/odd number inputs I can print it out (think ill need an if/else statement for this?) At the end I'd like it to look like this: Please enter a number between 1 and 5: 1 Blue. Even. Calm So far I've got the code below and have no idea how to finish or even progress, any ideas?
Back to
Seekers of Perl Wisdom
|
|