in reply to Re^2: logic problem with perl game
in thread logic problem with perl game
Like the following, and you need to use && not "and" (unless you get the precedence straight by using ()):
if(($response eq "arrow" && $theword eq "sparrow")) { ... } elsif(($response eq "axe" && $theword eq "wax")) { ... } elsif(($response eq "shield" && $theword eq "field")) { ... } elsif(($response eq "spear" && $theword eq "tear")) { ... } else { }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: logic problem with perl game
by Anonymous Monk on Dec 04, 2010 at 03:36 UTC |