Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exercises/practice/gigasecond/.meta/example.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
local gigasecond = {}

function gigasecond.anniversary(any_date)
return os.date('!%x', any_date + math.pow(10, 9))
return os.date('!%x', any_date + 10 ^ 9)
end

return gigasecond
6 changes: 2 additions & 4 deletions exercises/practice/run-length-encoding/.meta/example.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ return {
decode = function(s)
local result = ''
for length, c in s:gmatch('(%d*)(.)') do
if length == '' then
length = 1
end
result = result .. c:rep(length)
local n = (length == '') and 1 or tonumber(length)
result = result .. c:rep(n)
end
return result
end
Expand Down
Loading