03-14-2016 09:48 AM
How do you generate a random number? , can someone tell me if im on the right track?
03-14-2016 09:55 AM
The random number generator gives a number between 0 and .999999999.......
I'm going to assume you want something like between 1 and 6 if you were rolling a die. You will need to multiply the number and round it off. But the rounding method is important. Many people get lost in this point and wind up implementing something that doesn't give every number an equal probability of being generated.
Since you want 6 different numbers, multiply by 6 and round down towards 0. You'll get an integer between 0 and 5. Now add 1.
Always round down, never up, never to nearest.
03-14-2016 09:56 AM
Care to be more specific? You seem to already know about the Random Number (0-1) function.
03-14-2016 10:56 AM
Do you by any chance know how to create a "guessing game", on labview?
03-14-2016 10:57 AM - edited 03-14-2016 10:58 AM
@Ouzi101 wrote:Do you by any chance know how to create a "guessing game", on labview?
Yes. (once we know the rules of the game....)
03-14-2016 11:09 AM - edited 03-14-2016 11:19 AM
Well first off the program needs to have a secret number in memory , than the goal is for the person to guess that number and if the computer is supposed to tell you if you are true or false. If false itll tell you if you are to high or to low.
03-14-2016 11:20 AM
Sounds like you need to learn a little LabVIEW. Have you spent time (and made more than a token effort -- tried to do examples, tried to do what the Instructor was showing on your own PC) with the LabVIEW Tutorials, some of which can be found on the first page, upper right, of the LabVIEW Forums?
You need to be able to write LabVIEW code to do (at least) the following things:
Most of these are very elementary LabVIEW. If you want to learn LabVIEW, you'll need to ... "learn LabVIEW", which means you'll need to "do it yourself". The LabVIEW Tutorials are reasonable ways to start "learning it yourself".
If you "get stuck", or want to have your code analyzed/criticized, attach your VI (code) and we'll help you. If you want to learn LabVIEW, having us provide the "answer" for you without any effort on your part won't help you.
Bob Schor
03-14-2016 11:30 AM
I understand , ill go through the tutorials and try to learn it
03-14-2016 11:31 AM
@Ouzi101 wrote:I understand , ill go through the tutorials and try to learn it
Don't forget to ask questions and post your attempts so we can assist! 🙂
03-14-2016 11:35 AM - edited 03-14-2016 11:36 AM
He already asked about his guessing game last week.... http://forums.ni.com/t5/LabVIEW/Guessing-game/m-p/3264953
He was also linked to the tutorials (which he apparently hasn't looked at) and he was even given an almost complete solution...