Modulo:Sandbox/ppong

Versione del 21 mag 2015 alle 00:13 di Moroboshi (discussione | contributi) (la tabella ritornata da getargs ha alcune limitazioni, non funziona la funzione # e la maggior parte delle funzioni delle tabelle :D)
local getArgs = require('Module:Arguments').getArgs
local p= {}

local A= {
	["FRA"]= "Flag of France.svg"}

local B= {
	["FRA"]= "della "}

local C= {
	["FRA"]= "Francia"}

local D= {}

local E= {}

local Tipo= {}

local SB= {}

local BL= {}

local sport= {
	["CA"]= "Calcio"}

function p.db (frame)			--da completare, sempre che ne valga la pena
	if frame["args"][1] == "a" then
		return A[frame["args"][0]]
			end
	end

function p.visualizza (frame)	--da completare
	local out= "{| class=\"wikitable\" \n!codice !!bandiera !!genitivo\n"
	local e= "FRA"				--da sostituire con un ciclo
	out= out.."|-\n|"..e.."||[[file:"..A[e].."|20px]] "..A[e].."||"..B[e]..C[e].."\n"
	out= out.."|}"
	return out
	end

function p.nazNB (frame)
	local args = getArgs (frame)
--	local out= "[[nazionale"								-- si inizia a definire il link
--	if Tipo[args[1]] then
--		out= "[[selezione" end
--	if args[3] then
--		out= out.." "..args[3] end
--	out= out.." di "..sport[args[0]]
--	if args[2] == "M" then
--		out= out.." maschile"
--	elseif args[2] == "F" then
--		out= out.." femminile" end
--	if D[args[1]] then
--		out= out.." "..D[args[1]]
--	else
--		out= out.." "..B[args[1]]..C[args[1]] end
--	out= out.."|"..C[args[1]]								-- si definisce il testo del link
--	if args[3] and not args[4] then
--		out= out.." "..args[3] end
--	out= out.."]]"
        return args[1], args[2]
	--return #args .."--".. table.concat(args, "-") .."<br />"
	end

--function p.bandiera (frame)
	
--function p.naz (frame)
	
return p