Skip to content

Instantly share code, notes, and snippets.

View Leohige's full-sized avatar
🏠
Working from home

Leandro Matheus Leohige

🏠
Working from home
View GitHub Profile
@Uradamus
Uradamus / shuffle.lua
Last active November 3, 2023 09:39
A simple array shuffle function for Lua implementing the Fisher-Yates shuffle.
function shuffle(tbl)
for i = #tbl, 2, -1 do
local j = math.random(i)
tbl[i], tbl[j] = tbl[j], tbl[i]
end
return tbl
end