Jump to content

Module:Sandbox/QuinticFormula

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by QuinticFormula (talk | contribs) at 23:19, 2 April 2022 (Created sandbox module with FizzBuzz function). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
-- Module with a FizzBuzz function
-- Lua is fun!

local p = {}

function p.fizzbuzz(frame)
	local t = {}
	for i = 1, 100 do
		if i % 15 == 0 then
			t[i] = "FizzBuzz<br>"
		elseif i % 5 == 0 then
			t[i] = "Buzz<br>"
		elseif i % 3 == 0 then
			t[i] = "Fizz<br>"
		else
			t[i] = i .. "<br>"
		end
	end
	return table.concat(t)
end

return p