Skip to content

Instantly share code, notes, and snippets.

@gknauth
Created August 7, 2011 19:00
Show Gist options
  • Save gknauth/1130654 to your computer and use it in GitHub Desktop.
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
#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