summaryrefslogtreecommitdiffstats
path: root/4.lua
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-05-14 19:51:41 -0500
committerJesse Luehrs <doy@tozt.net>2009-05-14 19:51:41 -0500
commitc3ff98ee4aa79bcaa07c8a478e96539c2a512e73 (patch)
tree0b1a04ee7e5b05ec23dcfa274d4258f8acbcdf9d /4.lua
parent394121b98178246a0b1063e9104f8878cf2a17e5 (diff)
downloadprojecteuler-c3ff98ee4aa79bcaa07c8a478e96539c2a512e73.tar.gz
projecteuler-c3ff98ee4aa79bcaa07c8a478e96539c2a512e73.zip
rename files for better sorting
Diffstat (limited to '4.lua')
-rw-r--r--4.lua16
1 files changed, 0 insertions, 16 deletions
diff --git a/4.lua b/4.lua
deleted file mode 100644
index daec4bc..0000000
--- a/4.lua
+++ /dev/null
@@ -1,16 +0,0 @@
-local function is_palindrome(n)
- local first_half = string.sub(n, 1, string.len(n) / 2)
- local second_half = string.sub(n, -string.len(n) / 2)
- return first_half == string.reverse(second_half)
-end
-
-local prods = {}
-for i = 100,999 do
- for j = 100,i do
- table.insert(prods, i * j)
- end
-end
-table.sort(prods, function(a, b) return a > b end)
-for _, v in ipairs(prods) do
- if is_palindrome(v) then print(v) break end
-end