• Post Reply Bookmark Topic Watch Topic
  • New Topic

a topic for fun: a program for choosing a random number?  RSS feed

 
Samuel Weston
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey, I am actually a beginner, but I am looking to make a simple "fun" program. something interactive. this is really for me to get an idea and have fun with programming (and you guys)-so im more interested in what a possible program would look and your ideas more than if I can actually make the program or not.

so I am going to make a simple "guess what number im thinking" program (the user inputs a number-based on number there will be an automated response-either higher or lower. once the correct number is guessed,
an automated response of "you are correct" would be made)
except I would like to make the number that has to be guessed a randomly generated number as opposed to making it merely appear that its randomly generated.

on that matter-just interested in your opinion- would you say the same principles of the random number generator could be applied to...say... having a doll say a random choice of lines from a premade list of lines? (as opposed to it saying the same lines (e.g "I love you" and "your my best friend" etc) in order over and over?)
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Samuel Weston wrote:except I would like to make the number that has to be guessed a randomly generated number as opposed to making it merely appear that its randomly generated.
on that matter-just interested in your opinion- would you say the same principles of the random number generator could be applied to...say... having a doll say a random choice of lines from a premade list of lines? (as opposed to it saying the same lines (e.g "I love you" and "your my best friend" etc) in order over and over?)

Unfortunately, that's more of a choice for you, and it sounds like a visual one, rather than anything to do with the problem you're actually trying to solve.

If you want a variant on the "guessing game" idea (also based on random numbers), have a look at Bulls and Cows (also called "Mastermind" - I think there's a link in the page). It's a little more involved, but it might help you to understand the nature of random numbers. And it gives you a wide scope for "visual stuff".

HIH

Winston
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16059
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Samuel Weston wrote:except I would like to make the number that has to be guessed a randomly generated number as opposed to making it merely appear that its randomly generated.

What exactly do you mean here, what's the difference between a randomly generated number and a number that merely appears to be randomly generated?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!