Random Numbers

Non duplicating random numbers

Page 1 of 1

1 Replies - 966 Views - Last Post: 26 August 2009 - 05:11 AM Rate Topic: -----

#1 Bandisto  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 26-August 09

Random Numbers

Posted 26 August 2009 - 05:03 AM

I have a problem and it's not a huge one,i've generated random numbers from 1 to 90 and i don't want them to duplicate and again i want to sort them ......please help me out...[code]
Is This A Good Question/Topic? 0
  • +

Replies To: Random Numbers

#2 SwiftStriker00  Icon User is offline

  • No idea why my code works
  • member icon

Reputation: 433
  • View blog
  • Posts: 1,599
  • Joined: 25-December 08

Re: Random Numbers

Posted 26 August 2009 - 05:11 AM

When you create the number store it in a List<int> alreadySeen . The thereafter if the random number is not in alreadySeen, continue on else try again or do something else
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1