Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: logic problem with perl game

by apl (Monsignor)
on Dec 04, 2010 at 14:38 UTC ( #875371=note: print w/replies, xml ) Need Help??

in reply to logic problem with perl game

You should consider changing
{ $shield=param('shield'); $correctryhm=param('correctryhm'); $response=param('response'); $win=param('win'); $win=$win+1; }


{ $shield = param( 'shield' ); process(); } # .... sub process { $correctryhm = param('correctryhm'); $response = param('response'); $win = param('win'); $win=$win+1; }

This will reduce the size of your code.

Replies are listed 'Best First'.
Re^2: logic problem with perl game
by mynameisG (Novice) on Dec 04, 2010 at 23:16 UTC

    Sorry guys I made a mistake, I just realized something very important. For some reason $correctryhm is storing the value of the previous $theword. for example, if the first $theword equals field and I click on the picture of the shield I get +1 # of losses, but if the next $theword equals arrow and I choose shield again I get +1 to # of wins... so that's what needs to be fixed

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://875371]
[james28909]: Today would be scalar localtime. Yesterday would be scalar localtime - 1. sunday - monday would variate scalar localtime - ?
[james28909]: oops s/sunday - monday/sunday - saturday/
[james28909]: my mind is blown haha
[james28909]: hmm, i haz idea!

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2017-04-29 04:01 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (531 votes). Check out past polls.