Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question from a beginner

Status
Not open for further replies.

ffrkyu

Programmer
Sep 22, 2003
2
NZ
When I do ($a eq $b), I have several vaules for $a.
And if any one of them matches $b, it returns true.

so how can I assign those values to $a.

eg, $a can be 1,2,3
$b is 2.

$a=???

Thanks
 
It's not very clear what you're asking here. Can you clarify? Since $a is a scalar variable, how can it have several values?

Also, since the values you cite are numbers, rather than strings, you should be using ($a == $b), not ($a eq $b).
 
Actually, this is a web-based game.
I'm tring to figure out how to win it every time.

The code...

...
@b=(1,2,3,4,5,6);
$a1=$b[rand (@b)];
if($form_input eq $a1){You win and get some credits}
if($form_input ne $a1){Lose}

Can I put append something to the URL to make me a winner?
 
Your closing statement begs for a sarcastic remark, but I'll just wish you luck and move on. I don't participate here to help cheat at games.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top