RandInt: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">randInt ( lowerbound, upperbound )</syntaxhighlight> | <syntaxhighlight lang="lua">int randInt ( int lowerbound, int upperbound )</syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
* '''lowerbound''': This is the lowest random value this function can return. | * '''lowerbound''': This is the lowest random value this function can return. | ||
* '''upperbound''': This is the highest random value this function can return. | * '''upperbound''': This is the highest random value this function can return. | ||
===Returns=== | |||
Returns an [[int]] containing a random number between and potentially including ''lowerbound'' and ''upperbound''. | |||
==Example== | ==Example== | ||
This example outputs a random number between 5 and 10 inclusive. | |||
<syntaxhighlight lang="lua">outputChatBox ( "A random value between 5 and 10 is ", randInt ( 5, 10 ) )</syntaxhighlight> | <syntaxhighlight lang="lua">outputChatBox ( "A random value between 5 and 10 is ", randInt ( 5, 10 ) )</syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Utility functions}} | {{Utility functions}} |
Revision as of 14:21, 14 August 2006
Description
This function returns a random integer value between a specified minimum and maximum value.
Syntax
int randInt ( int lowerbound, int upperbound )
Required Arguments
- lowerbound: This is the lowest random value this function can return.
- upperbound: This is the highest random value this function can return.
Returns
Returns an int containing a random number between and potentially including lowerbound and upperbound.
Example
This example outputs a random number between 5 and 10 inclusive.
outputChatBox ( "A random value between 5 and 10 is ", randInt ( 5, 10 ) )
See Also
- addDebugHook
- base64Decode
- base64Encode
- debugSleep
- decodeString
- encodeString
- fromJSON
- generateKeyPair
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getRealTime
- getTickCount
- getTimerDetails
- getTimers
- getFPSLimit
- getUserdataType
- getVersion
- gettok
- isTransferBoxVisible
- setTransferBoxVisible
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isTimer
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- removeDebugHook
- resetTimer
- setDevelopmentMode
- setFPSLimit
- setTimer
- ref
- deref
- sha256
- split
- teaDecode
- teaEncode
- toJSON
- tocolor
- getProcessMemoryStats
- utfChar
- utfCode
- utfLen
- utfSeek
- utfSub
- bitAnd
- bitNot
- bitOr
- bitXor
- bitTest
- bitLRotate
- bitRRotate
- bitLShift
- bitRShift
- bitArShift
- bitExtract
- bitReplace