rand()
From Hack Wars Wiki
| Information for free function rand() | |
| Function | rand() |
| API | Attacking, Banking, FTP, Watch, HTTP, Challenges, Hacktendo |
| Description | Returns a float between 0 and 1. |
Example
message(getSourceIP(), rand()+""); |
This would send a message with a float between 0 and 1.
Example 2
int generateRandomNumber(int lowerBound, int upperBound) { int range = upperBound - lowerBound; return ( intValue( ( rand() * range ) ) + lowerBound ); } |
This will return an int value which is equal to or greater than lowerBound and less than upperBound.
See intValue()
