Modulo:Carte: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
test per sostituire template:carte |
fix vari |
||
(2 versioni intermedie di uno stesso utente non sono mostrate) | |||
Riga 17:
-- * oppure "Jolly" / "Jollyr" / "Jollyn" : Jolly / Jolly (rosso) / Jolly (nero)
local
['c'] = { name='cuori', symbol='♥'},
['f'] = { name='fiori', symbol='♣'},
['p'] = { name='picche', symbol='♠'},
['q'] = { name='quadri', symbol='♦'}
}
Riga 45:
['n'] = 'black',
['r'] = 'red'
}
function p.main(frame)
end
Line 56 ⟶ 55:
local output = {}
local hand = {}
local hand_style = args['stile mano'] or '
local suits_color = {}
suits_color['c'] = args['colore cuori'] or 'red'
suits_color['p'] = args['colore picche'] or 'black'
suits_color['
suits_color['f'] = args['colore fiori'] or 'black'
local card_style = args['stile carte'] or ''
Line 66 ⟶ 65:
local color = (args['colore'] and color_code[args['colore']]) or ''
dump(output,
local pos = 1
local continue = true
while continue do
local value = 1
local card = args[pos]
if card then
local card_array = {}
local suit_rank
local card_color
local last_character = mw.ustring.sub(card, -1)
local suit_code
if suits[last_character] then
suit_code = last_character
end
if suit_code then
card_color = suits_color[suit_code]
else
card_color =
end
if card_color then
suit_rank = mw.ustring.sub(card, 1, -2)
else
suit_rank = card
Line 93 ⟶ 97:
end
end
dump(
if suit_rank then
dump(
end
if suit_code then
dump(
end
dump(card_array, '</span>')
pos = pos + 1
dump(hand, table.concat(card_array))
else
continue = false
end
end
dump(output, table.concat(hand, separator) or '')
dump(output, '</b
return table.concat(output)
end
|