Compile with erl -compile genetic.erl
then erl run genetic test
.
Created
December 13, 2015 20:41
-
-
Save Dzol/08ac722726e66d9f27da to your computer and use it in GitHub Desktop.
Response to "String Handling" - Erlang Central
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
-module(genetic). | |
-export([transcribe/1, test/0]). | |
transcribe(Sequence) when is_list(Sequence) -> | |
[t(X) || X <- Sequence]. | |
t($G) -> $C; | |
t($C) -> $G; | |
t($T) -> $A; | |
t($A) -> $U. | |
test() -> | |
"ACUG" = transcribe("TGAC"). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment