語言

Extensions.RandomNext(IMemory, Int32, Int32, Nullable<Int32>) 方法

定義

從屬性中產生隨機種子和數值。 若值非空值,模擬隨機值結果為:最小值 + (值 % (最大值 - 最小值))。 否則如果種子不是空的,隨機的種子就會被固定。

public static int RandomNext(this AdaptiveExpressions.Memory.IMemory memory, int min, int max, int? seed = default);
static member RandomNext : AdaptiveExpressions.Memory.IMemory * int * int * Nullable<int> -> int
<Extension()>
Public Function RandomNext (memory As IMemory, min As Integer, max As Integer, Optional seed As Nullable(Of Integer) = Nothing) As Integer

參數

memory
IMemory

記憶體狀態。

min
Int32

隨機數的包含性下界返回。

max
Int32

隨機數的排他上界被回傳。 最大值必須大於或等於最小值。

seed
Nullable<Int32>

使用者種子。

傳回

隨機種子和數值。

適用於