Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Getting around nested conditionals

by nevyn (Monk)
on Sep 27, 2006 at 21:10 UTC ( [id://575254]=note: print w/replies, xml ) Need Help??


in reply to Getting around nested conditionals

As I understand it you have:
| 1-2 4-8 ---------------- 1-2 | a b 4-8 | c d 16-32 | e f
...the way to do this is to have a row/col -> values mapping, sort that and loop. Ie.
my $row_map = [{min => 1, max => 2}, {min => 4, max => 8}, {min => 16, max => 32}]; my $row = undef; for (0..2) { if (($row_map->[$_]->{min} <= $y) && ($row_map->[$_]->{max} >= $y)) { $row = $_; last } }
--
And-httpd, $2,000 security guarantee
James Antill

Log In?
Username:
Password:

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

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

    No recent polls found