You can also play Dark Warriors on
Back to post list
Back a step


seelesh01
Posts: 4,418
Status: Lord

Karma: +19
[+1] [-1]

Offline

Subject: conditions problem (explained)
Felt in all the conditions something isnt clear to me.

Taking a sample code for example:

if(NUMBER > 10000 AND NUMBER < 10100){
You have gained +1 helix!
}
if(NUMBER > 10100 AND NUMBER < 10110){
You have gained +1 sapphire!
}
if(NUMBER > 10110 AND NUMBER < 12000){
You have gained +1 strength!

The larger NUMBER in one condition follows to be the Lower NUMBER in the next condition this is fine. But the operators used makes it buggy if i may say (nut sure if the word is appropriate here)...

If 10100 < Number < 10110 gives +1 sapphire and
If 10110 < Number < 12000 gives +1 strength,

What happens when we get Number = 10110? this isnt in the condition since there arent any ">=" or "<=" operators.

Can i be enlightened please?

Actually: the operator < includes = in PHP. didnt know that.. ty Felt for Clarification.

Time Posted: January 30 2011 07:56 am EST
Last updated: January 30 2011 10:58 am EST


Replies:

Add reply:
Subject:
Body: