Created
August 7, 2011 19:00
-
-
Save gknauth/1130654 to your computer and use it in GitHub Desktop.
generate list of numbers from 0 to n-1 but in randomized order
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
#lang racket | |
; shuffle-list is interesting, check it out! | |
(require games/cards/utils) | |
; seed the random number generator | |
(random-seed (modulo (current-milliseconds) 10000)) | |
; generates list of numbers from 0 to n-1 but in randomized order | |
(define (random-number-list n) | |
(shuffle-list (for/list ((i (in-range 0 n))) i) n)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment