More Examples

## Introduction

This is a collection of other examples or answered questions about the functions of Perchance. If you have any questions, look on the list below and you may find the answer. To ease finding the topic, we provided tags (not final) to help search for the existing question or topic.

## Examples

Topic Tags Legend
* About using Perchance Methods or properties and syntax.
 Using Plugins
* About using Plugins and other ways to use them.
 Formatting
* About formatting the output/code.
 HTML
* About HTML code, formatting and others.
 CSS
* About CSS stylings.
 JavaScript
* About using JavaScript functions, libraries, methods and others.
 Other
* Examples that don't fit into any tag

NoteThis is just a example tags and **NOT FINAL**. Please provide feedback and suggestions to better *tag* the examples in their category. Also feel free to tag the following examples.
* `selectMany` dice based on previous roll and use `sumItems` to get sum (M)
* Roll number of dice based on previous roll (M)
* Draw a spatial grid/map with emojis (M-F)
* Add up randomly generated numbers (M)
* Choose a list based on a randomly selected number (M)
* Append items to list when button is clicked (M)
* Prepend generated items to a "history" box (M-F-H)
* Hide the output until the user clicks a button (explanation) (M)
* selectLeaf plugin (M-P)
* "consumable" hierarchies (M-P)
* Matching pronouns based on gender. The "Dynamic Sublist Referencing" section explains this. (M)
* Dice game thing that uses an if/else block. (M)
* Passing variables into lists (explanation) (M)
* Consumable List with Dynamic Odds (explanation) (M)
* Write list items with indented HTML. (M-F-H-J)
* Assign "roles" to a bunch of characters with a consumable list (M)
* Using a consumable list with a list of items that have nested properties/lists (i.e. a hierarchy) (M)
* Generate three numbers which all add up to 100 (M-J)
* Click to unhide some hidden text (useful to show extra details) (M-H)
* Custom mouse cursor (H-C)
* Counting the selections that are made from a list (M)
* Display a random image, given a list of URLs (M-H)
* Display a random image, cropped to 200x200 pixels, given a list of URLs (M-H-C)
* Add an image to each list item so the image gets output alongside the text (M-H-C)
* Display a random image along with your random text (M-H-C)
* Display a random image along with your random text (a bit more complicated than the above example) (M-H-C)
* Generate acronyms from words using a custom function (M-J)
* A basic p5.js example (the JavaScript "library" taught on Khan Academy) (J-H-C)
* Calculate and display the total number of possible permutations/results that your generator has (M)
* Use dynamic sub-list referencing to generate random incomes based on a randomly selected city (M)
* Randomize automatically at regular time intervals (M-J-H)
* Generate sequential presidents with random terms (4 or 8 years) such that the years don't overlap (M)
* Using If/Else within dynamic odds statements (M-J)
* Always generate the same thing based on a particular "seed" keyword (uses seeder-plugin)(M-P)
* Multiple independent outputs with random numbers of items generated in each (M-J)
* Generate a lineage of kings with correctly-sequential roman numeral names (M-P)
* Basic example using a color picker input (M-H)
* Use inputs to calculate distance traveled based on fuel remaining and fuel consumption rate (M-H-J)
* Convert Fahrenheit to Celcius, and vice versa. Also, miles to kilometers and vice versa. (M-J)
* Select a sublist from a list, and then get that sublist's "name" using sublist.getName (M)
* Display numbers with commas - like 974,384,837 instead of 974384837 (M-J)
* Exclude an item from a list based on a previous selection(M)
* Change the odds of an item based on a previous selection's parent
* Make output text editable (e.g. so users of your generator can customize before screenshotting)
* Change output based on user's screen size
* Bingo table example using make-table-plugin
* Find and replace text using regex
* Replacing/renaming certain combinations of outputs with some new text
* Use CSS to change make the text align left instead of center
* Get the median of some randomly generated numbers
* Filter/exclude an item from a list
* Embed a randomness "seed" in the URL of your generator
* Pass a variable to your generator via the URL
* Add a input box that allows the user to choose how many outputs they get
* Another example of an input box that lets you choose how many items to output
* Remember the user inputs (drop-downs, text boxes, etc.) so you can close the tab or refresh it and it keeps the values
* A simple click counter
* Another simple click counter approach
* Increment a counter when a specific items is selected
* Increment a counter to label each generated item with a number
* Generate colored text
* Use a custom image as a button
* Use an image as a button and change the button when they hover and click (And here's a simpler version with only a hover effect)(J)
* Add a title, description and image to your generator so that when you share it as a link on social media, it has a nice link preview
* Display a specific result (rather than a random one) when the page is loaded
* Display different results depending on how many times they've clicked the "randomize" button
* Show a message that only comes up when the page first loads
* A consumableList that doesn't get "reset" each time the randomize button is clicked
* Add items to a list when a button is clicked
* Use .map to convert a whole list of items into their sub-properties/items
* Add an input box that lets you choose a specific number of items to output
* Combining the tap-plugin and random-image-plugin to make an image randomize when you tap it
* Select a random sub-list and then get the first N items of that sub-list, where N is a randomly chosen number
* Draw from a deck of cards with a button and use another button to reshuffle the deck when all cards have been drawn
* Sequentially numbered outputs
* Another sequentially numbered outputs example, but using HTML's `ol` tag
* Check if some text contains some other text and change the probability of an item based on whether it does
* Add two user inputs to a list
* Add many user inputs to a list
* Allow the user to create a new list with their inputs
* `update()`ing dynamically generated elements
* Use the image-layer-combiner-plugin to generate random video thumbnails based on a generated video title
* Selecting a sublist and using its name, and then selecting an item from that sublist
* Changing a drop-down list's current value without the user clicking it
* Use multiple drop-down lists to allow the user to define a pattern that is used to generate the output
* Generate a drop-down user input from a hierarchical list
* Use the seeder plugin for one import or list only (the others stay completely random)
* Dynamically creating a list and adding items to it
* Filter a list based on generated instance properties
* Generate a list of instances and then filter them based on their properties
* Use a simple custom function to roll a dice and calculate damage, and count the number of rolls above 3
* Tap some text to randomize only that text (similar to tap-plugin), but a tappable sub-item appears sometimes.
* Combine multiple lists into a single consumable list
* Add a function within a list and create an instance of that list
* Combining list that contain duplicates without selecting duplicates
* User inputs text in a text box to see if their answer to the question is correct
* Select the highest number from a set of randomly generated numbers
* Using curly brackets inside square brackets
* An array of instances within a single instance using the createInstance and createInstance**s** plugins
* Sequential "pages" example. Clicking a button brings you to the next page of content.
* selectMany/selectAll, and then transform all the selected list items using a simple instruction like `item => item.upperCase`
* Randomize the colors of an image using a CSS filter
* Using curly blocks (e.g. `{1-5}`) inside square blocks
* HTML for generating bullet-point lists
* Prevent randomization of list except at page reload
* Track selections & display other properties of selected items later
* Show some text only after something has been clicked ("spoiler" / "unfold content")
* Combine the goto plugin with the comments plugin to create "rooms" that have their own comments box
* A template for a plugin that just returns some CSS and HTML
* Select item from same index/position in two lists