From Clomosy Docs
(Created page with "This function is a custom function used on the Clomosy platform. It is employed to generate a random number between two numerical values. The randomly generated number within the function is inclusive of the first parameter but exclusive of the last parameter. clMath.GenerateRandom(value1,value2:Integer):Integer '''Example:'''<br> In the example, when the program is executed, a random number between 10 and 20 will be generated. To guess this number, a numeric input mu...") |
ClomosyAdmin (talk | contribs) No edit summary |
||
| (4 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert"> | |||
clMath.GenerateRandom(value1,value2:Integer):Integer | |||
</div> | |||
This function is a custom function used on the Clomosy platform. It is employed to generate a random number between two numerical values. The randomly generated number within the function is inclusive of the first parameter but exclusive of the last parameter.<br> | |||
In the example, when the program is executed, a random number between 10 and 20 will be generated. | <b>Example</b><br> | ||
In the example, when the program is executed, a random number between 10 and 20 will be generated.<br> | |||
<pre> | |||
var | |||
NumberOfPredictions : Integer; | |||
{ | |||
NumberOfPredictions = clMath.GenerateRandom(10,20); | |||
ShowMessage('The generated number: '+IntToStr(NumberOfPredictions)); | |||
} | |||
</pre> | |||
<b>Output:</b><br> | |||
<div class="alert alert-success" role="alert" data-bs-theme="light"> | |||
The generated number: 10 | |||
</div> | |||
<h2> See Also </h2> | |||
* [[ClMath | ClMath]] | |||
{{#seo:|title=GenerateRandom in Clomosy - Clomosy Docs}} | |||
{{#seo:|description=Learn to generate random numbers using the clMath.GenerateRandom function in Clomosy.}} | |||
Latest revision as of 15:15, 24 December 2024
clMath.GenerateRandom(value1,value2:Integer):Integer
This function is a custom function used on the Clomosy platform. It is employed to generate a random number between two numerical values. The randomly generated number within the function is inclusive of the first parameter but exclusive of the last parameter.
Example
In the example, when the program is executed, a random number between 10 and 20 will be generated.
var
NumberOfPredictions : Integer;
{
NumberOfPredictions = clMath.GenerateRandom(10,20);
ShowMessage('The generated number: '+IntToStr(NumberOfPredictions));
}
Output:
The generated number: 10