summaryrefslogtreecommitdiffstats
path: root/RNA.rs
blob: 9c20887490148df203d7bff10cf00e5cd33222e0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use 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));
    }
}