http://www.perlmonks.org?node_id=972106


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

score = 56, although I don't really understand your spec. Why doesn't f(4) = 1,2,4?

Replies are listed 'Best First'.
Re^2: mini-golf: convert integer into list of powers of two
by tobyink (Canon) on May 23, 2012 at 22:01 UTC

    f(7) is (1,2,4) because 7 is 1+2+4.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'