Last active
August 29, 2015 14:06
-
-
Save otto-schnurr/f100b869d75c612ef8a3 to your computer and use it in GitHub Desktop.
A Swift solution for http://rosalind.info/problems/rna/.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/xcrun swift -F . | |
// FileInput module from https://github.com/otto-schnurr/FileInput-swift | |
import FileInput | |
func complement(base: Character) -> Character { | |
switch base { | |
case "T": return "U" | |
default: return base | |
} | |
} | |
let dna = input().nextLine()! | |
print(String(seq: map(dna, complement))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment