[LRUG] ShRUG Golf update
james at lazyatom.com
Thu May 12 03:11:49 PDT 2011
On 12 May 2011 11:10, Tom Stuart <tom at experthuman.com> wrote:
> 7. Murray wrote: "the tests don't say that Golf needs to be a class, so we can define Golf as a constant and just add methods to it. So we can [...] open up the metaclass of Golf, which happens to be a constant of an empty string, rather than a class". You might also save characters by assigning a more useful object to Golf if its methods are worth calling in your solution. e.g. if you do Golf=Hash (only 2 characters longer than Golf='') then you can turn "Hash.new" into "new" (5 characters shorter).
That is fiendish. Love it.
More information about the Chat