Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.lisp
Re: [newbie] Help with loop, progn
William James
2/23/2016 3:00:00 PM
Matthew Danish wrote:
> (defun write-dna-seq (seq-size &optional (stream *standard-output*))
> "Writes a DNA sequence of length seq-size to the given stream. DNA
> sequence consists of characters chosen from (A T G C)"
> (loop repeat seq-size do
> (princ (aref #(A G T C) (random 4))
> stream)
> ;; Return value not important
> (values)))
MatzLisp (Ruby):
def make_dna size
Array.new(size){'acgt'[rand 4]}.join
end
make_dna 64
==>"tctttcctcacaataggaacttaggggagacggtctgttacatcggaatgacgacaatctgata"
--
[A]n unholy alliance of leftists, capitalists, and Zionist supremacists has
schemed to promote immigration and miscegenation with the deliberate aim of
breeding us out of existence in our own homelands.... [T]he real aim stays the
same: the biggest genocide in human history.... --- Nick Griffin
(
https://www.youtube.com/watch?v=K...
)
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: [newbie] Help with loop, progn
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password