Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Uninitialized warnings trouble

by jwkrahn (Abbot)
on Dec 14, 2022 at 04:04 UTC ( [id://11148849]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Uninitialized warnings trouble
in thread Uninitialized warnings trouble

Using the code you posted and the data above I get the answer:

2429

This code also gives the same answer:

#!/usr/bin/perl use strict; use warnings; # 2429 my @row = do { open my $lines, '<', 'input8.txt'; map [ /\d/g ], <$lines>; }; my $visible = 198; for my $current ( 0 .. $#row ) { if ( $current > 0 && $current < 98 ) { $visible += 2; COUNT: for my $i ( 1 .. 97 ) { my $counter = 1; while ( $row[ $current ][ $i - $counter ] < $row[ $current + ][ $i ] ) { if ( ++$counter == $i ) { ++$visible; next COUNT; } } while ( $row[ $current ][ $i + $counter ] < $row[ $current + ][ $i ] ) { if ( ++$counter == $i ) { ++$visible; next COUNT; } } while ( $row[ $current - $counter ][ $i ] < $row[ $current + ][ $i ] ) { if ( ++$counter == $current ) { ++$visible; next COUNT; } } while ( $row[ $current + $counter ][ $i ] < $row[ $current + ][ $i ] ) { if ( ++$counter == $current ) { ++$visible; next COUNT; } } } } } print "$visible\n";

Log In?
Username:
Password:

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

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

    No recent polls found