03-08-2016 06:08 PM - edited 03-08-2016 06:29 PM
I have to create a program that simulates a lottery generator. The Numbers have to be 1-69 and the numbers cannot show up more than once. Please help
PLEASE HELP.... i know you guys are seeing this
03-08-2016 06:46 PM - edited 03-08-2016 06:53 PM
First read this.
http://www.catb.org/esr/faqs/smart-questions.html
Second, come up with a better subject for your message. This is a LabVIEW forum. Everyone on here is asking for help about LabVIEW.
Third, show what you have done so far. We can't help you when you haven't posted any code.
That reminds me. I need to call my mechanic to help me fix my car. I won't tell him what is wrong. I won't bring it in. I'll just ask him to troubleshoot it over the phone. I'll tell him on the phone to "PLEASE HELP.... I know you can hear me"
Fourth, is this homework? It sure sounds like it is. No one is going to give a solution to you. If you are smart enough, you can search the forums and probably find the answer. But make sure you understand how it works. It would look bad to your instructor if you turned in an assignment and you weren't able to tell him how you arrived at your solution.
03-08-2016 06:50 PM
Well since My teacher just gave us this assigment without telling us anything before hand. so i had no idea what to say , this is why i came here
03-08-2016 06:52 PM
Then go back to your teacher and ask questions.
Have you ever touched LabVIEW before? If you are a "self-starter", start by looking at some tutorials.
03-08-2016 06:57 PM
Yes i have, i've used it a few times. I have basic knowledeg of arrays, case structures and numeric things. Thats about it.
I have one of those teachers that expects us to learn everything on our own so even if i did ask him questions he wouldn't help me.
03-08-2016 07:11 PM
Before you touch LabVIEW, put down on paper exactly how you would do it as a form of pseudocode.
You'll certainly need a loop. You will need a random number generator which provides a number n where 0<= n < 1. (It's in the palettes). You will need to do some basic math to convert that to 1 to 69. Be sure you understand what a shift register is in LabVIEW, I'm sure you'll need to use one or two of them.
With basic knowledge of arrays, you should be able to write the pseudocode, then it won't be that hard to convert to LabVIEW code.
03-08-2016 07:13 PM
Thanks and one last thing. When i run the program a number can not be repeated. How do i preven that?
03-08-2016 07:16 PM
Keep an array that tells you what numbers have already been picked. If you pick that number again, then repeat the random number until you don't. (That is where a shift register will come in handy.)
03-09-2016 12:46 PM
The way I would do this that's pretty simple is this:
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
03-09-2016 01:21 PM
@RavensFan wrote:First read this.
http://www.catb.org/esr/faqs/smart-questions.html
That link is amazing, thank you RavensFan!