This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

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

 
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?)
 
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
 
Java Cowboy
Sheriff
Posts: 16084
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!