Created
February 23, 2012 02:49
-
-
Save a-suenami/1889435 to your computer and use it in GitHub Desktop.
sorting program with Lua.
This file contains 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
data = {2, 32, 12, 0, 493, 4, 5, 32} | |
for i = 1, #data do | |
for j = i + 1, #data do | |
if data[i] >= data[j] then | |
tmp = data[i] | |
data[i] = data[j] | |
data[j] = tmp | |
end | |
end | |
end | |
for key, val in pairs(data) do | |
print('data['..key..'] = '..val) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment