« Introduction au Lua/Fonctions Table » : différence entre les versions

Contenu supprimé Contenu ajouté
Ligne 76 :
#* The MediaWiki software caches page results. It is necessary to purge the server page cache to see new results. See {{tlx|Purge}} for more information.
# <code>for i = 1, 10, 1 do</code> creates a loop code block that will repeat <code>10</code> times.
# <code>table.insert(numbers, math.random(1, 10))</code> calls the <code>math</code> library <code>random</code> function to retrieve a random number between <code>1</code> and <code>10</code>, inclusive, and then inserts that value into the <code>numbers</code> table.
# <code>table.concat(numbers, ', ')</code> retrieves the values in the table <code>numbers</code> and converts them into a string concatenated with <code>', '</code> separators between each value.
# <code>table.sort(numbers)</code> sorts the <code>numbers</code> table in the default ascending order.