On 31/03/2013, at 1:42 AM, sto.mar / web.de wrote:

> Am 30.03.2013 08:19, schrieb Julian Leviston:
>>=20
>>=20
>> On 30/03/2013, at 3:42 AM, Jeremy Henderson <lists / ruby-forum.com> =
wrote:
>>=20
>>> Yes, I love how compressed it is. Like Regis' though, it can't =
handle
>>> apostrophes. I assume I'll need to add some kind of exception for =
them
>>> into it.
>>=20
>> By the way, compressed is overrated IMHO. If you love compressed, you =
might like PERL, or if you like powerful ideas expressed simply, you =
might like LISP.
>> However, when it comes time to actually maintain code (and all code =
needs maintaining), you will probably find simple Ruby to be much easier =
to read and understand.
>>=20
>> Clarity around capturing of intent can't be overrated in my opinion =
when it comes time to programming.
>=20
> I don't have the previous messages around anymore, so I'm not sure
> whether this has been brought up before, but I don't think so.
>=20
> Very clear in my opinion is String#tr:
>=20
>  "hello world".tr('aeiou', '*')    # =3D> "h*ll* w*rld"
>=20
>=20
> --=20
> <https://github.com/stomar/>
>=20

I apologise! You're absolutely right! This will translate single =
characters in place. I didn't understand what it did. Silly me.

class String
def dna_conv
self.upcase.tr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", =
"AAAAAABBBBBBCCCCCCDDDDDDDD")
end
end

puts "DNAS: Sequencing Open... Input? "
while (word=3D$stdin.gets.chomp).size>1
puts word.dna_conv
puts
puts "DNAS: Additional Input? "
end

Julian