Good, so you want the program to choose a random number between 1 and (total number of students), which will be the winner. This number is tied to student numbers, so if # 45 is accidentally chosen, student # 45 wins.
It looks like you already have this bit, so next time you want some kind of lottery for slot machines to scroll through the names and “make a show” to select a winning number. The winning number will probably be completely separate from the lottery animation, so there is no reason for choosing random numbers to take longer than necessary (this is just one line of code).
So, for your animation, why not just skip each of the entries in your list of students, show them each one or two times one after another, and then in the third cycle it stops at the winning name and underlines it accordingly, For example: Mark, Jane , Dave, Mark Jane, Dave, Mark, JANE - WINNER !! Obviously animated and stylish, but you like it.
In short, the answer you are looking for is to select a winner, not displaying it immediately, and then repeating all the names a certain number of times and finally landing on the winner. Hope this helps you in the right direction without programming for you :)
source share