Execute command, Howto ?

jean-pierre Ortolland shared this question 4 years ago
Answered

Hi


this is already several times that I try to add this Geogebra file (joined).


oddly this one appears in my collection after pressing Share, but the next day it is not present anymore ?


https://www.geogebra.org/ortollj


do we are limited in number of shared Geogebra files ?


secondly what I have to put in the script of the button "Execute N Random" for executing Nrandom times the script in random button.


I tried with sequence execute command without succes .


Sequence( execute[


# this code below in "Scripting" -> "On Click" Tab of the "Random" Button


# random button is just an ok button which has been renamed


Couples_{random} = Shuffle( Couples_{names})


Ones = Flatten[Sequence(If(Element(Couples_{random}, i)== Element(Couples_{random}, i + n / 2), 1, 0), i, 1, Length(CouplesPoints))]


Delete(SegList)


SegList=Sequence(If(Element(Ones, i)== 1, Segment((x(Element( CouplesPoints,i ) ),y(Element( CouplesPoints,i ) )), (x(Element( CouplesPoints,i+n/2 ) ),y(Element( CouplesPoints,i+n/2 ) ))) ), i, 1, Length(CouplesPoints))


Count=Count +1


S= Sum(Ones)+S


Expectation=S/Count


], i, 1, Nrandom )

Best Answer
photo

Repeat(Nrandom,RunClickScript(Random))

only this one command in the button "Execute N Random"

.

by the way:

good style in GGB-Scripts is:

SetValue(<free object>, <ommand | object>) instead of <object>= <ommand | object>

Comments (1)

photo
1

Repeat(Nrandom,RunClickScript(Random))

only this one command in the button "Execute N Random"

.

by the way:

good style in GGB-Scripts is:

SetValue(<free object>, <ommand | object>) instead of <object>= <ommand | object>

© 2022 International GeoGebra Institute