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
;; 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)) |
0 件のコメント:
コメントを投稿