Generating list of million random elements

Posted by Fakrudeen on Stack Overflow See other posts from Stack Overflow or by Fakrudeen
Published on 2010-03-13T08:09:50Z Indexed on 2010/03/13 8:15 UTC
Read the original article Hit count: 164

Filed under:

How to efficiently generate a list of million random elements in scheme? The following code hits maximum recursion depth with 0.1 million itself.

(unfold (lambda(x)(= x 1000000)) (lambda(x)(random 1000)) (lambda(x)(+ x 1)) 0)

© Stack Overflow or respective owner

Related posts about Scheme