Module:Dice: Difference between revisions

15 bytes added ,  14:20, 31 July 2019
permit spaces everywhere (purely cosmetic)
(add comment with repository url)
(permit spaces everywhere (purely cosmetic))
Line 28: Line 28:
     local diceTable = {}
     local diceTable = {}


     for term in diceString:gmatch'[+-]?[^+-]+' do
     for term in diceString:gsub('%s', ''):gmatch'[+-]?[^+-]+' do
         local quantity, size = term:match'^([+-]?%d+)d(%d+)$'
         local quantity, size = term:match'^([+-]?%d+)d(%d+)$'