10-18-2022 03:31 PM
Good evening.
I am a Labview beginner. Before joining the community group I searched but I couldn't understand much. I'll explain my problem: I have a 1D array string and I would like to extract all the strings from this array, one at a time (like a bingo abacus) and gradually reduce the size of this array. is it achievable?
Is it possible to save the remaining elements in a document?
Thank you all,
Cheers
P.S. : i am apologies for my english
Solved! Go to Solution.
10-18-2022 03:56 PM
Try this:
10-19-2022 04:35 AM
Thank you, it works perfectly.
Assuming I want to extract values at random, the only solution is to use the shuffle funtion before my array?
I have tried and it works.
10-19-2022 05:23 AM
Hi Oivlis,
@Oivlis wrote:
Assuming I want to extract values at random, the only solution is to use the shuffle funtion before my array?
You might use the RandomNumber function (and IndexArray) instead of shuffling the whole array…
10-19-2022 12:57 PM - edited 10-19-2022 01:04 PM
@GerdW wrote:
Hi Oivlis,
@Oivlis wrote:
Assuming I want to extract values at random, the only solution is to use the shuffle funtion before my array?
You might use the RandomNumber function (and IndexArray) instead of shuffling the whole array…
Except that with each random removal, the random range needs to be reduced.
You did not really explain the problem in detail. Are you more interested in the extracted elements (one at a time) or in the ever shrinking remaining array that ultimately has zero length, i.e. is no longer interesting at all!?
Constantly resizing arrays can be expensive and clumsy. Can you take a step back and tell us what you really want to do with all this? My guess is that you are overcomplicating things. Start with explaining the term "bingo abacus". What is it? Do you have a link?
10-20-2022 01:03 PM
Hi,
first of all I would like to thank everyone.
The project became this:
I have a constant array of strings, where strings are the names of waiter .
A waiter name is extracted at each iteration of the for loop and this name is removed from the list. The array is reshuffled and the extraction continues.
I added background music to create suspense.
10-20-2022 05:23 PM - edited 10-20-2022 05:25 PM
@Oivlis wrote:
The project became this:
I have a constant array of strings, where strings are the names of waiter .
A waiter name is extracted at each iteration of the for loop and this name is removed from the list. The array is reshuffled and the extraction continues.
Sounds like homework assignment...
How/when does the waiter get re-inserted?
What happens if there are not enough waiters?
What happens if there are too many waiters? (IE. some one might never get picked due to shuffling each time. Someone might get picked too often...)
So many questions...
10-21-2022 10:11 AM
@Oivlis wrote:
Assuming I want to extract values at random, the only solution is to use the shuffle funtion before my array?
With your latest information, this shuffling is a good solution. If you leave the Delete from array 'clean', without any numbers connected you'll get the last element as the deleted part and keep the rest.
So, Shuffle array, Extract last element as winner, and repeat with the now 1 shorter array.
10-22-2022 01:43 PM
Hi,
sorry if I answer only now.
it's a homework but it wasn't assigned to me. I have recently become a systems teacher and I have to learn this software that I have never used. I'm doing it with homework that I find on the web (also the core manul1)
the questions you me give me many ideas to reflect.
I thank you.