Skip to content

Instantly share code, notes, and snippets.

@otto-schnurr
Last active August 29, 2015 14:06
Show Gist options
  • Save otto-schnurr/f100b869d75c612ef8a3 to your computer and use it in GitHub Desktop.
Save otto-schnurr/f100b869d75c612ef8a3 to your computer and use it in GitHub Desktop.
A Swift solution for http://rosalind.info/problems/rna/.
#!/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