in reply to Re^2: perl array matrix
in thread perl array matrix

Maybe it would help if you define the distance function for your matrix and tell us that function?

Replies are listed 'Best First'.
Re^4: perl array matrix
by Anonymous Monk on Apr 12, 2015 at 12:09 UTC
    it is something like word search puzzle games . but word search puzzle ONLY return horizontal,vertical + X direction . I need to see Y , Z , L or zigzag directional as well.

      Maybe you can then explain to us what "nearby" means? Maybe show a concrete example and explain why one set is "nearby" and another, very similar set is not "nearby"?

      Just telling us "word puzzle" does not help. There are many types of word puzzles and your numbers don't explain at all how they relate to word puzzles.

        nearby mean the the next search character or number is the

        neighbour of my current position of "character or number"

        example number 2 neighbour number = 1,3,5,6,7

        number 7 neighbour number = 2,3,4,6,8,10,11,12

        number 12 neighbour number = 7,8,11,3,16

        and 16 inside the 12 neighbour's numbers so "2,7,12,16" consider related each others so should return "true".