From: ts Date: 2006-08-03T19:31:05+09:00 Subject: Re: What's wrong with this recursive function?? >>>>> "K" == Knut erik Teigen writes: very quickly look K> #checks column K> col = j K> for i in 0..8 K> if grid[i*9+col]==value K> return false K> end K> end K> #checks box K> #integer math to find start of box # 'i' is always == 8 (see the loop 'for') K> i0=(i/3).to_i*3 K> j0=(j/3).to_i*3 # useless (#to_i) and false moulon% ruby -e 'i = 1; p i/3' 0 moulon% K> for i in i0...i0+3 Guy Decoux