From: David Alan Black Date: 2002-08-06T19:45:30+09:00 Subject: Re: Coding challenge (on Ruby Garden) Hi -- On Tue, 6 Aug 2002, Tom Sawyer wrote: > On Tue, 2002-08-06 at 01:20, Avi Bryant wrote: > > So, what are the criteria for the challenge, apart from passing the > > tests? This obviously isn't golf, but the stats for my solution are: > > > > bytes: 139 > > lines: 3 > > expressions: 1 > > assignments: 0 > > did you calculate those yourself or is there a way to get a readout of > these factors? > > while we're at it i decided to run a simple speed compare just to see > how they match up. they are all pretty close. these are the fastest > reported times i got for each solution after running each one many many > times: > > Transami AviBryant BillKelly DavidNaseby DavidBlack > .005810 .005827 .005831 .006141 .009374 > > by the way, david's is picking up a failure on: > > def test_true_3 > items = [ 1,2 ] > rows = [ [2,1], [3,1] ] > assert(one_in_each(items,rows)) > end > > but considering it was the first one and this test came later and it was > his idea! (i think), that's okay ;-) I respectfully decline the verdict of okay-ness :-) There's definitely something wrong with my algorithm... leaving aside the fact that the whole thing is a lot longer than 139 bytes :-) David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav