Module:Ups and downs sharpness: Difference between revisions

Tristanbay (talk | contribs)
No edit summary
Tristanbay (talk | contribs)
may work with placeholders now but I have to test it
Line 20: Line 20:
end
end
tab = tab .. "|-\n!Sharp symbol\n|rowspan=\"2\"| [[File:Heji18.svg|15px]]\n"
tab = tab .. "|-\n!Sharp symbol\n|rowspan=\"2\"| [[File:Heji18.svg|15px]]\n"
for i = 1, sharp * 2 + 1 do
tab = tab .. "|"
if ((i - (sharp * floor(i / sharp))) / sharp) > math.floor(((i - (sharp * floor(i / sharp))) / sharp) + 0.5) then
if (i - (sharp * floor(i / sharp))) % 5 == 4 then
tab = tab .. "down quip "
else
for j = 1, (i - (sharp * floor(i / sharp))) % 5 do
tab = tab .. "up "
end
end
for j = 1, floor((i - (sharp * floor(i / sharp))) / 5) do
tab = tab .. "quip "
end
else
if ((sharp * ceil(i / sharp)) - i) % 5 == 1 then
tab = tab .. "up quid "
else
for j = 1, ((sharp * ceil(i / sharp)) - i) % 5 do
tab = tab .. "down "
end
end
for j = 1, floor(((sharp * ceil(i / sharp)) - i) / 5) do
tab = tab .. "quid "
end
end
if math.floor((i / sharp) + 0.5) == 1 then
tab = tab .. "sharp "
elseif math.floor((i / sharp) + 0.5) == 2 then
tab = tab .. "doublesharp "
end
tab = tab .. "\n"
end
tab = tab .. "|-\n!Flat symbol\n"
tab = tab .. "|-\n!Flat symbol\n"
for i = 1, sharp * 2 + 1 do
tab = tab .. "|"
if ((i - (sharp * floor(i / sharp))) / sharp) > math.floor(((i - (sharp * floor(i / sharp))) / sharp) + 0.5) then
if (i - (sharp * floor(i / sharp))) % 5 == 4 then
tab = tab .. "up quid "
else
for j = 1, (i - (sharp * floor(i / sharp))) % 5 do
tab = tab .. "down "
end
end
for j = 1, floor((i - (sharp * floor(i / sharp))) / 5) do
tab = tab .. "quid "
end
else
if ((sharp * ceil(i / sharp)) - i) % 5 == 1 then
tab = tab .. "down quip "
else
for j = 1, ((sharp * ceil(i / sharp)) - i) % 5 do
tab = tab .. "down "
end
end
for j = 1, floor(((sharp * ceil(i / sharp)) - i) / 5) do
tab = tab .. "quip "
end
end
if math.floor((i / sharp) + 0.5) == 1 then
tab = tab .. "flat "
elseif math.floor((i / sharp) + 0.5) == 2 then
tab = tab .. "doubleflat "
end
tab = tab .. "\n"
end
tab = tab .. "|}"
tab = tab .. "|}"
return tab
return tab