In scheme I have to use random to define a procedure that accepts no arguments and returns an integer in the range 1 to 10, inclusive and i cant use if. im lost =(
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your Scheme provides a
randomfunction, you want eitheror
depending on whether you have
(random n) --> integer in [0, n-1])or(random) -> float in [0,1]Be advised that this isn’t standards-compliant. For absolute portability, write your own RNG.