Jump to content
  • 0

Distinct Array


ToiletMaster

Question


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

Hi everyone,

 

i have a question to ask. is there any possibility to select from an array and make sure that the selection is distinct?

 

for example

 

if i set an array of

 

setarray .random[0], 100,200,300,400,500,600,700,800,900,1000;

Is there a possibility that if i pick a number from this array, that it will not be repeated anymore?

 

a quick solution would be putting the number in a variable and checking it, but that's only if it works with 1 time checks,

 

what if i had 5 different times i'm selecting from this array that requires a distinct selection.

Edited by ToiletMaster
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   431
  • Joined:  01/26/16
  • Last Seen:  

Store selected numbers in another array or removed selected number from the array.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...