(Racket) 로또 번호 생성 #lang racket (let loop ([r (set)]) (cond [(>= (set-count r) 6) (display r)] [else (loop (set-add r (add1 (random 45))))])) My Computer Programs 2012.09.01
(Go) 로또 번호 생성 package main import ( "fmt" "math/rand" "time" ) func main() { r := map[int]bool{} rand.Seed(time.Now().UnixNano()) for len(r) < 6 { r[rand.Intn(45)+1] = true } for x := range r { fmt.Println(x) } } My Computer Programs 2012.08.27