(random) bi-wired

To practice SICP problems by schema, I use the online schema interpreter in repl.it, which is biwass. But the thing is the function is (random n)

missing, when I do (random 10)

it shows an error, is there some basic workaround so what can I include (random n)

?

+3


source to share


1 answer


There is random-integer

:

(random-integer 10)
;=> 3

      

Since it works exactly the way SICP wants it random

, we can name the name with ease.



(define random random-integer)
(random 10)
;=> 5

      

If you continue to work with the online editor, you can simply save this definition at the top of the editor clipboard and you should be set!

+3


source







All Articles