The Dink Network

Reply to This symbol

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
August 16th 2005, 04:03 PM
pillbug.gif
Drink
Peasant He/Him Chile
Don't drink 
In this line:

if (hurt_thing(i, (spr[h].strength / 2) + ((rand() % ((spr[h].strength+1) / 2))+1), 0) > 0)

...What does that symbol "%"?
It is really complicated to read that line, so I have simpified it. Here:
----

StrenghtDiv2 = spr[h].strength / 2;
Random = rand();
StrenghtPlus1Div2 = (spr[h].strength + 1) /2;

if (hurt_thing(i, StrengthDiv2 + ((Random % StrengthPlus1Div2) +1), 0) > 0)
----

What operation produces (Random % StrengthPlus1Div2)?

Also, please correct me on this if it is incorrect:

/ means division
// means comment until end of line
/* means the start of a commented block
*/ means end of commented block.

(A || B) means OR, like (10 or 01) = 11
(A && B) means AND, like 11 and 00 = 00
(!A) means NOT A

The strange thing is that I saw (A & B) and (A | B), with only single symbol each.
So, in that way, these symbols means something different?