Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Golf code in perl

by thospel (Hermit)
on Jan 22, 2018 at 23:28 UTC ( [id://1207716]=note: print w/replies, xml ) Need Help??


in reply to Golf code in perl

Oooh, a golf thread. also 44 strokes:

m? ?||map$\+=2*$s[$_%$']++,split for<>;print

In older perls you could leave out the initial m and it would have been 43

Replies are listed 'Best First'.
Re^2: Golf code in perl
by thospel (Hermit) on Jan 25, 2018 at 00:25 UTC
    And for 40:

    print<>!~($/=$")+2*map 1..$s{$_%$'}++,<>

Log In?
Username:
Password:

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

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

    No recent polls found