Translation Project

Well if you’re really going for brevity you might as well do this:

break if (str=gets.chomp).empty?

On 31/03/2013, at 1:42 AM, [email protected] wrote:

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.


https://github.com/stomar/

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=$stdin.gets.chomp).size>1
puts word.dna_conv
puts
puts "DNAS: Additional Input? "
end

Julian