summaryrefslogtreecommitdiffstats
path: root/RNA.rs
blob: 228dafc09a9c24b750364d1878af0212061f33d5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use core::io::{stdin,stdout,ReaderUtil,WriterUtil};

extern mod rosalind;
use rosalind::dna::transcribe;

fn main() {
    let stdout = stdout();
    for stdin().each_char() |ch| {
        // each_char returning -1 here is a bug
        if (ch == '\n' || ch == (-1 as char)) {
            stdout.write_char('\n');
            return;
        }
        stdout.write_char(transcribe(ch));
    }
}