-
Notifications
You must be signed in to change notification settings - Fork 6
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
ISS-26: Implement array_get_random / array_pop_random (yet again) #41
Conversation
First, made them return undefined instead of 0 for empty arrays/subsections. Second, fixed formatting and phrasing of the JSDocs. Also, added regions.
… because I'm pedantic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few real minor notes.
Testing random functions is always a pain. In principle, I'd say "mock the random number generator" and use dependency injection to test it or something, but that's massively overengineered, especially since GM doesn't really have a good concept of non-global random generators.
Community Toolbox/scripts/tests_ArrayPopRandomTests/tests_ArrayPopRandomTests.gml
Show resolved
Hide resolved
…n the source array anymore
Fixed the phrasing of the overall demo description, and also moved offset/length buttons and descriptions to have more space for array values listing.
👍 LGTM! |
Building upon biyectivo's implementation from PR #39. Changes include: