Adam Groves wrote:
> Hi there,
>
> I'm trying to write a class which converts a number into letters like
> so:
> 0  => -
> 1  => A
> 10 => J
> 27 => AA

Try this:

n = ""
while(n > 0)
  s << ?A + n % 26 - 1
  n /= 26
end
n << "-" if n.empty?
s.reverse

Also, your @alphabet is ("a".."z").to_a

Cheers,
Dave