Call rnd(table) to get a random table element#14
Open
andrewedstrom wants to merge 1 commit intowh0am1-dev:gh-pagesfrom
Open
Call rnd(table) to get a random table element#14andrewedstrom wants to merge 1 commit intowh0am1-dev:gh-pagesfrom
andrewedstrom wants to merge 1 commit intowh0am1-dev:gh-pagesfrom
Conversation
As of 2.0.0, you can call `rnd` with a table as the argument to get a random element from the table. This PR adds that to the `tables` tab. From the [PICO-8 manual](https://www.lexaloffle.com/pico-8.php?page=manual): ``` rnd x Returns a random number n, where 0 <= n < x If you want an integer, use flr(rnd(x)) If x is an array-style table, return a random element between table[1] and table[#table]. ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As of 2.0.0, you can call
rndwith a table as the argument to get a random element from the table.This PR adds that to the
tablestab.From the PICO-8 manual: