From: Glenn Parker Date: 2005-04-12T00:48:35+09:00 Subject: Re: Translating A Pattern of Data Into Equation, and ultimately code Martin Ankerl wrote: > > Wow, very good! I could not figure this out myself. Here is the very > simple formula: > > def encode(letter, column) > (letter-?a + 1)^column > end Golf, anyone? This "encodes" the full string: s.gsub(/./){|c|((c[0]-?`)^($`.size+1)).chr} -- Glenn Parker | glenn.parker-AT-comcast.net |