Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Find range in coordinates array

by huck (Prior)
on Sep 30, 2019 at 18:53 UTC ( [id://11106886]=note: print w/replies, xml ) Need Help??


in reply to Re: Find range in coordinates array
in thread Find range in array with indices

what if it were 7-23 and 7-133 where each size of the - was its own integer co-ord, and 7.23 was actualy 7.0023 and 7.133 was 7.0133

Quick untested idea for fix

sub fixit { my $pt=shift; my ($x1,$x2)=split(/\./,$pt); return sprintf ('%08i.%08i',$x1,$x2); } .... last if (fixit($cursorPosition) <= fixit($tagBegin));
Much optimzation could be done to that, but it gives you the idea

Replies are listed 'Best First'.
Re^3: Find range in coordinates array
by IB2017 (Pilgrim) on Oct 01, 2019 at 20:45 UTC

    Thank you. I played a bit with your idea (your assumption was right) and I managed to get a working solution. However, I finally used the solution proposed by Haukex because it seems... simply perfect.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-19 19:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found