v=[[1,2],[2,3],[3,4]];
echo(search([1,2],v));
returns [0,1]
I would like it to return [0] i.e. to match the vector as a unit .
any ideas? I can use a recursive function or even a list comprehension but
they must be quite slow.
Chris
--
View this message in context: http://forum.openscad.org/search-function-tp11171.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Try making it a list of vectors instead of a list of numbers:
echo(search([[2,3]],v));
echo(search([[2,3],[3,4],[1,2]],v));
Andrew.
On Jan 21, 2015, at 8:22 AM, kitwallace kit.wallace@gmail.com wrote:
v=[[1,2],[2,3],[3,4]];
echo(search([1,2],v));
returns [0,1]
I would like it to return [0] i.e. to match the vector as a unit .
any ideas? I can use a recursive function or even a list comprehension but
they must be quite slow.
Chris
--
View this message in context: http://forum.openscad.org/search-function-tp11171.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
--
"The future is already here. It's just not very evenly distributed" -- William Gibson
Genius! Many thanks.
--
View this message in context: http://forum.openscad.org/search-function-tp11171p11174.html
Sent from the OpenSCAD mailing list archive at Nabble.com.