-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Two questions about the code #11
Comments
Hi @juanchi, this is part of code that generates the items displayed in the reel. random-name-picker/src/assets/js/Slot.ts Lines 173 to 193 in 44481db
It works by taking the first N (default is 40) items from the shuffled name list to form an sublist, then treat the last item in the sublist as the winner. If the renaming names in the name list is less than the number of items to display, it concats the list again until it has enough item. |
Thank you so much for your response, @icelam . I may not have explained myself clearly. If I have a list of names comprising, let's say, 500 names, will the code account for all 500 names? Or will I have to change it from 40 to 500? |
@juanchi, the code will always account for the 500 names provided. Every time "Draw" button is pressed, the whole 500 items shuffle and form a subarray of display items. |
This is definitely an awesome piece of code. I have two questions, not issues. I understand that the animation only displays a maximum of 40 numbers, which are taken randomly from the entered list, but the final result isn't necessarily one of those 40 numbers displayed in the animation; it's taken from the complete list, right? Also, could you please guide me to the part of the code that calculates the winner randomly? Thanks.
The text was updated successfully, but these errors were encountered: