From: "studlee2@..." Date: 2006-07-16T01:05:06+09:00 Subject: Re: Who likes Sudoku? I'm not really sure about the whole "GOLF" vs. "golf". We'll say 'GOLF'.downcase and call it even. I think 'golf' is the right way to refer to squeezing code. _Steve dblack@wobblini.net wrote: > Hi -- > > On Sun, 16 Jul 2006, studlee2@gmail.com wrote: > > > Here is the smallest Ruby Sudoku solver I could come up with. I've > > seen a bunch that are really big, but this is the most simplistic. I'd > > like to shrink it a bit more, but it works well for now. Things like > > reading in the ARGV line as Integers could remove all the ".to_i" tags. > > Another line could be removed if the hash is declared within the loop > > instead of the top of the subroutine. Is there are way to loop through > > numbers 1..9 using the 10.times notation so I don't have to skip '0' -- > > it'd be nice to remove that line too? Can we GOLF this anymore? I'm > > Has GOLF become a "backronym"? I thought it was just "golf", but I > keep seeing it in uppercase. > > > going to keep refining it, so I'll post any updates later on. This was > > a fun problem - Ruby Rocks! > > Anyway -- sure you can reduce it a bit. Change $puzzle to $p, to > start with, and get rid of a bunch of spaces :-) (I haven't looked at > the logic yet so my suggestions are pretty cosmetic.) > > > David > > -- > http://www.rubypowerandlight.com => Ruby/Rails training & consultancy > http://www.manning.com/black => RUBY FOR RAILS (reviewed on > Slashdot, 7/12/2006!) > http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log > dblack@wobblini.net => me