Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
How do I get a random number between two random numbers?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Josh Cheek, post: 4652742"] [Note: parts of this message were removed to make it a legal post.] In that case, the cardinality of the solution set is 1, perhaps not desirable for a guessing game, but it is not stated that this should not happen, and if no minimum range is specified, then it is subjective where that line is drawn. ie if a solution set with cardinality 1 is not appropriate, then what about a solution set with cardinality two? At what point do we say the numbers are sufficiently far apart that they are acceptable? Perhaps a different approach is required altogether. Instead of giving the maximum value the numbers can be, give the minimum and maximum difference between the numbers. I don't see much value in a minimum number anyway, choosing a random number between 90 and 100 doesn't seem to offer anything over choosing a minimum number between 0 and 10. While I think saying "give me an upper bound between 10 and 20, with a target between 0 and that number" is a better approach, it is not what was asked for, and I thought it would be better to answer the question as asked, than to impose my own restrictions. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
How do I get a random number between two random numbers?
Top