Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: perl array matrix

by Laurent_R (Canon)
on Apr 12, 2015 at 11:11 UTC ( [id://1123202]=note: print w/replies, xml ) Need Help??


in reply to perl array matrix

It is not very clear to me. My guess is that you are trying to use an array of arrays, probably something like this:
( [1, 2, 3, 4,], [5, 6, 7, 8,], [9, 10, 11, 12,], [13, 14, 3, 16,], [2, 18, 19, 20,] )
but you'll have to explain why "2,7,12,16" and "2,4,7,12" should return true and why "1,6,8,12" and "1,5,14,15" should return false. Well, "1,5,14,15" being false, I can understand a plausible reason, because 15 is nowhere in the data structure, but why "1,6,8,12" should be false?

Je suis Charlie.

Replies are listed 'Best First'.
Re^2: perl array matrix
by Anonymous Monk on Apr 12, 2015 at 11:59 UTC
    Hi ; Je suis Charlie. : This is due to the "2,7,12,16" and "2,4,7,12" numbers are nearby each others . and the others are not. in term of matrix x and y position.

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

        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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1123202]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-03-29 00:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found