Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: mini-golf: convert integer into list of powers of two

by tobyink (Canon)
on May 24, 2012 at 12:30 UTC ( [id://972236]=note: print w/replies, xml ) Need Help??


in reply to Re: mini-golf: convert integer into list of powers of two
in thread mini-golf: convert integer into list of powers of two

That's 32 by my reckoning...

Using the assign-within-grep trick I applied to BrowserUK's solution, it is possible to take it down to 31 though:

0 1 2 3 1234567890123456789012345678901 sub{grep$_[0]&($_=1<<$_),0..31}
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2024-04-19 09:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found