Loading [MathJax]/extensions/tex2jax.js

2010年7月19日月曜日

Lotto: Draw N different random numbers from the set 1..M

;; P24 (*) Lotto: Draw N different random numbers from the set 1..M.
;; The selected numbers shall be returned in a list.
;; Example:
;; * (lotto-select 6 49)
;; (23 1 17 33 21 37)
;; Hint: Combine the solutions of problems P22 and P23.
(require "p22.ss")
(require "p23.ss")
(define (lotto-select num max-elm)
(rnd-select (range 1 max-elm) num))
view raw p24.ss hosted with ❤ by GitHub

0 件のコメント:

コメントを投稿