Question: Do-loop with time delay to view sequential nature

 

I have a button and a math container where the button code is given below.

The code simple generate 4 random numbers when you press the button and save the random numbers in a list which

is displayed in the math container.

 

with(DocumentTools):
with(Statistics):

to 4 do

r:=evalf(Sample(RandomVariable(Normal(0,1)),1)[1],1);

if not assigned(LL) then LL:=[r] else LL:=[op(LL),r] end if;

end do;

Do(%MathContainer3=LL);
 

 

Now when I click on the button the Do loop is so fast that it looks like the 4 random variable are generated simultaneously.

I want to find a way to introduce a time delay in the do-loop so we can view the sequential nature of the do loop when

we press the button for example  click on button   gives us random1  pause    random2   pause  random3  pause  random4

How can this be done ?  :-)

 

Please Wait...