My wife is tinkering with the intersection of my world (machines) with her world (biology), and made the mistake of wondering aloud if a program could be written to generate random gene sequences (GTAC, etc.)
Why? Beats me. But it sure sounded like golf. So, without further ado:
Write a program to produce a string of any given length of a random sequence of the letters G, T, A, and C.
I came up with a one-liner in 41:
perl -e 'for(1..shift){print qw(G T A C)[rand(4)]}' 1000
Humblest apologies in advance if this is too easy, too dull, too hard, been done, etc.
Peace,
-McD
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: MiniBioGolf
by jmcnamara (Monsignor) on Feb 21, 2002 at 00:25 UTC | |
|
Re: MiniBioGolf
by blakem (Monsignor) on Feb 20, 2002 at 22:51 UTC | |
by tilly (Archbishop) on Feb 20, 2002 at 23:05 UTC | |
|
Re: MiniBioGolf
by giulienk (Curate) on Feb 21, 2002 at 14:34 UTC |