How to generate a list of random integer values from a button?

jospercomp shared this question 5 months ago
Answered

Sequence(RandomBetween(1, 8), i, 1, n, 1)

Use this command to generate a list of integer random values, but how do I make those values in the list change from a button and how does the SetSeed command work?

Best Answer
photo

dummy = 0
Sequence(RandomBetween(1, 8+0dummy), i, 1, n, 1)

then in your button

SetValue(dummy, 0)

Comments (4)

photo
2

define l1={}

define n


define a buttom with setvalue(l1,Sequence(RandomBetween(1, 8), i, 1, n)) in clickscript

if you want put in script a setseed() command optionaly

photo
1

It is not change in my apps.

photo
photo
2

Bonjour,


il suffit de copier cette commande dans le script de ton bouton


sans SetSeed l1 et l2 sont différentes


avec SetSeed les listes suivantes sont identiques

https://wiki.geogebra.org/e...

Files: alea.ggb
photo
2

dummy = 0
Sequence(RandomBetween(1, 8+0dummy), i, 1, n, 1)

then in your button

SetValue(dummy, 0)

© 2021 International GeoGebra Institute