Random number generator avoiding duplicates. - SL3
Aug 16, 2023
I realize SL360 may be easier to complete this project. Alas, I cannot upgrade currently. I do, however, need help with the random number generator I am using to create a set of flash cards. One slide with 50 layers.
I created a variable randum and used the following js to generate a random number and linked it to specific slides with triggers. Altho tedious, that was easy.
var randomnumber = Math.floor((Math.random()*50)+1);
var player = GetPlayer();
player.SetVar("randnum",randomnumber);
(2) Questions:
1. How do I avoid duplicate numbers appearing regularly when I run the app?
2. How do I end the app when all cards have been used.
Any suggestion would be helpful. I am a js newbie.
1 Reply
here is a small example, how it could work
idea
on timeline start init the array
on button click
https://360.articulate.com/review/content/76c46afa-6543-47f7-8c64-3d040fea47a0/review