From: Greg Millam Date: 2006-02-19T16:48:21+09:00 Subject: Re: [QUIZ] metakoans.rb (#67) MenTaLguY wrote: > On Sat, 2006-02-18 at 23:41 +0900, Patrick Hurley wrote: > >> I also have 13; however, two lines exceed 80 columns. Additionally, I >> have no support for multiple attributes on one line -- seems logical >> to have... > > > > 13 seems to be the lower limit without seriously golfing. My "best" > solution at this point runs about 18 lines, but it'd be 13 if I took out > all the blank lines and one line that makes it faster but doesn't affect > the semantics. Mine's at 9 without any real golfing. No newlines though. Maximum line length's 67, and that's the largest by far. I use "cond ? true : false" 4 times though, and that could be cleaner, I imagine. However: While it passes all the tests, it might have some poor flaws in real world use. i.e: * Anything with the same hash would have the same attributes. (i.e: 2 string objects containing the same text) * Every instance of the class that uses the attribute is kept in memory so long as the class is. * foo? returns the value, instead of exact true/false. While this is legit, it can't be used in (a.foo? == false) conditionals. But that's unrubylike anyway :D - Greg