09-15-2014 07:02 AM
You're right. I don't think it takes into account a repeat number, unless that's covered by the array, which I wasn't able to index properly to get it to work. I'm liking apok's solution. I think I can add functionality for the powerball number by generating like the first and expanding the OR gate.
09-15-2014 08:17 AM
@hungryhobbit wrote:
You're right. I don't think it takes into account a repeat number, unless that's covered by the array, which I wasn't able to index properly to get it to work.
What is "it"? What is "covered by the array"? What did not work? Show us what you did.
The riffle solution also guarantees that there are no repeat numbers.
@hungryhobbit wrote:
I think I can add functionality for the powerball number by generating like the first and expanding the OR gate.
What do you mean by that? The powerball number can be indentical to one of the five other ones, so no comparison is needed. Why would you need an OR function? Please show us your code instead.
09-15-2014 10:10 AM
It hasn't been mentioned yet, but I noticed your labels are all missing, both on the front panel and block diagram for controls. Don't do this, it is like making a variable but not giving it a name in a text based language.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-15-2014 05:08 PM
Sorry, I apologize for being so vague. What I meant to say was: I could not see in your while loop where it generates a sixth random number. I built your "quick alternative" code exactly as you laid it out, but it required an "element" input for the Search 1D array, and no matter what value I put in it, it didn''t work.
My other comment was regarding the OR gate. As I said, "newbie." And thank you for your patience. This is, like, my third post in here, ever. There are others who choose to be pricks less than civil about less than masters.
My other comment was about apok's solution and the OR gate. As I said, I couldn't see it generating a 6th number of a different numeric range, so I was going to add another for loop to do that, but now I know that's not needed for a single number to be spit out separately from the while loop, as it would having nothing to compare to.
I will try to implement that and see how it goes.
09-21-2014 08:27 AM
Okay, I've got a working solution. It's not very eloquent, but it works, for anyone who wants to use it.
I'm sure there are practices I could have used, like a sequence structure or others, but it does what I want it to do.
09-21-2014 09:59 AM - edited 09-21-2014 10:01 AM
Hi hobbit,
I'm sure there are practices I could have used, like a sequence structure or others
No, you don't want sequences. You don't need them…
Please
- DON'T delete the label of controls. Never! Hide them in the FP, but DON'T DELETE them!
- A loop run only once (either FOR or WHILE) doesn't make sense. Remove it. Use DATAFLOW to ensure correct execution order: error clusters preferred…
- Why do you need your "super number" presented in an array? Why not use a scalar numeric indicator?
- When something depends on a condition: use a CASE structure. Using a FOR loop to run zero or one time is quite "creative"…
- Using funny colors in the BD even for the "main" space (not just to highlight some loops/structures is IMHO unattractive…
09-21-2014 11:54 AM - edited 09-21-2014 11:55 AM
Gerd already pointed out some important things. Note that your ugly diagram background maked the boolean wire basically invisible. Not good!
Here's one possibility (LabVIEW 9.0)....