Because each function in Typst is purely functional, there can’t be any state internal to the function (it can’t remember anything). This means we need to give different arguments if we want different outputs (in this case different orderings).
Each time Suiji generates a random number it takes the rng value and also returns a new value that needs to be stored. Then that new value is passed into the next function to use randomness.
You code becomes:
#import "@preview/suiji:0.4.0": *
#let rng = gen-rng(1)
#let randomize(options-arg, rng-arg) = {
let (rng-local , options-local) = shuffle(rng-arg, options-arg)
(rng-local, options-local.join(", "))
}
#let options = ("A", "B", "C", "D")
#let (rng, output) = randomize(options, rng)
#output
#let (rng, output) = randomize(options, rng)
#output
#let (rng, output) = randomize(options, rng)
#output
#let (rng, output) = randomize(options, rng)
#output
#let (rng, output) = randomize(options, rng)
#output
Results in:
D, B, C, A
C, B, D, A
C, D, B, A
B, C, A, D
D, A, C, B