mynameisG has asked for the wisdom of the Perl Monks concerning the following question:
I have a game that I am working on. It is a math game, every time the math problem is correct the user plants a crop, but if the math problem is wrong the plant dies. I want to make it so that every time the user gets the math problem right, a picture of corn appears on the screen (i.e. for 3 right math problems 3 pictures of corn appear) here is my if statement that gives the user +1 corn or +1 dead corn...
if($game eq "Plant") { $userResponse=param('userResponse'); $realtotal=$number1 + $number2; $crops=param('crops'); $deadcrops=param('deadcrops'); if ($userResponse == $realtotal) { $crops=$crops+1; } if ($userResponse != $realtotal) { $deadcrops=$deadcrops+1; }
How would I add some kind of img src to the if statement to make the pictures appear? or would it not be in the if statement? Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: use perl to print multiple images
by JavaFan (Canon) on Dec 02, 2010 at 14:53 UTC | |
|
Re: use perl to print multiple images
by moritz (Cardinal) on Dec 02, 2010 at 14:44 UTC | |
|
Re: use perl to print multiple images
by PeterPeiGuo (Hermit) on Dec 02, 2010 at 14:58 UTC | |
|
Re: use perl to print multiple images
by tospo (Hermit) on Dec 02, 2010 at 15:48 UTC |