[BangPypers] golf problem

Kenneth Gonsalves lawgon at gmail.com
Mon Dec 26 11:05:40 CET 2011


On Mon, 2011-12-26 at 10:01 +0530, Pratap Chakravarthy wrote:
> # Initialize variables
> holes, bk = HOLES[:],   {} ;
> random.shuffle( holes )
> 
> # Make buckets
> [ bk.setdefault(y, []).append((x,y)) for x, y in holes ]
> 
> # Result
> print [ bk[3].pop(0), bk[4].pop(0), bk[5].pop(0) ] + random.sample(
> bk[3] + bk[4] + bk[5], 3 )
> 
> Some times the crude method is the best method ? 

just curious - why do you and Noufal think this is a crude method?
-- 
regards
Kenneth Gonsalves



More information about the BangPypers mailing list