Skip to content

Sequence

This example demonstrates that a Generator produces a deterministic sequence of values. Each call to NextInt() returns the next value in the sequence.

Expected Output

<value_1>
<value_2>
<value_3>

Outputs three consecutive values from the deterministic sequence. The same seed always produces the same three values in the same order.

Source Codes

package main
import "github.com/pseudata/pseudata"
func main() {
gen := pseudata.NewGenerator(42, 0)
println(gen.NextInt())
println(gen.NextInt())
println(gen.NextInt())
}