Jump to content
Sign in to follow this  
pejuge2

Matriz Por Contagem

Recommended Posts

pejuge2    1
pejuge2

Esse sistema identifica as posições dos números:

 

local tabela = {
{1, 3, 5},
{1, 5, 2},
{4, 9, 7}
}

function consecutive(matrix, min, max)

local txt

for all = min, max do
  txt = 'Número ' .. all .. ': '
  for all2 = 1, #matrix do
     for all3 = 1, #matrix[all2] do
        if matrix[all2][all3] == all then
           txt = txt .. all2 .. '/' .. all3 .. '; '
        end
     end
   end
   print(txt)
end

end

consecutive(tabela, 0, 9)

Share this post


Link to post
Share on other sites
pejuge2    1
pejuge2

Quero agradecer a todos os comentários aqui postados (nenhum).

Share this post


Link to post
Share on other sites
Socket    0
Socket

Muitíssimo complexo '

Tinha feito essa função uns tempos atrás

Publica seu sistema inteiro de matrizes. kkk

Muito tenso.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×