# File lib/modai_prct12/matrizDispersa.rb, line 17 def to_s fil = 0 print "[" while fil < filas col = 0 while col < columnas # Hay datos en la fila if matriz[fil] != nil if matriz[fil].has_key?(col) print "#{matriz[fil][col].to_s}" else print "0" end else print "0" end if (col + 1) < columnas then print ", " end col += 1 end if (fil + 1) < filas then print ", " end fil += 1 end print "]" end