local p = --p stands for package
function p.isHappy(n) --get single digits local lastDigit local tmp = 0 lastDigit = n % 10 tmp = tmp + lastDigit^2 return tmp --sum up the squares
end
return p
This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Module:Sandbox/Fulla07".
Except where otherwise indicated, Everything.Explained.Today is © Copyright 2009-2024, A B Cryer, All Rights Reserved. Cookie policy.