Created
September 11, 2018 14:11
-
-
Save Dreomite/8b567cfcdab902445eee01eef300bd76 to your computer and use it in GitHub Desktop.
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
| local array_like_table = { | |
| "You", | |
| "are", | |
| "a", | |
| "heretic" | |
| } | |
| --[[ | |
| [1] = "You" | |
| [2] = "are" | |
| [3] = "a" | |
| [4] = "heretic" | |
| ]] | |
| local map_like_table = { | |
| bae = "Sigmar", | |
| blessing = "This ravaged body", | |
| is_this_a_potion = true | |
| } | |
| --[[ | |
| ["bae"] = "Sigmar" | |
| ["blessing"] = "This ravaged body" | |
| ["is_this_a_potion"] = true | |
| ]] | |
| local mixed_table = { | |
| "My", | |
| "precious", | |
| "comrades", | |
| Bardin = true, | |
| Sienna = true, | |
| Kruber = true, | |
| Kerillian = "Elf, you're doing it wrong!" | |
| } | |
| --[[ | |
| [1] = "My" | |
| [2] = "precious" | |
| [3] = "comrades" | |
| ["Bardin"] = true | |
| ["Sienna"] = true | |
| ["Kruber"] = true | |
| ["Kerillian"] = "Elf, you're doing it wrong!" | |
| ]] | |
| -- But you can easily make array- and map-like tables mixed: | |
| array_like_table.heretics_slain = 1342 | |
| --[[ | |
| [1] = "You" | |
| [2] = "are" | |
| [3] = "a" | |
| [4] = "heretic" | |
| ["heretics_slain"] = 1342 | |
| ]] | |
| map_like_table[2] = "By the Hammer and the Bell!" | |
| --[[ | |
| [2] = "By the Hammer and the Bell!" | |
| ["bae"] = "Sigmar" | |
| ["blessing"] = "This ravaged body" | |
| ["is_this_a_potion"] = true | |
| ]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment