Perl Monk, Perl Meditation | |
PerlMonks |
Re: logic problem with perl gameby PeterPeiGuo (Hermit) |
on Dec 04, 2010 at 01:34 UTC ( [id://875307]=note: print w/replies, xml ) | Need Help?? |
1) As a starter, for those if conditions, instead of using "and", use &&. "and" has a very low precedence. 2) Your else is only paired with the last if. Chain those if's together with if/else if/else. Peter (Guo) Pei
In Section
Seekers of Perl Wisdom
|
|