diff --git a/exercises/practice/gigasecond/.meta/example.lua b/exercises/practice/gigasecond/.meta/example.lua index 6eaeb9b7..0528e393 100644 --- a/exercises/practice/gigasecond/.meta/example.lua +++ b/exercises/practice/gigasecond/.meta/example.lua @@ -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 diff --git a/exercises/practice/run-length-encoding/.meta/example.lua b/exercises/practice/run-length-encoding/.meta/example.lua index b69b599e..4226f068 100644 --- a/exercises/practice/run-length-encoding/.meta/example.lua +++ b/exercises/practice/run-length-encoding/.meta/example.lua @@ -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