Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Need the code for Randomization of numbers using c#

Need the code for Randomization of numbers using c#

Scheduled Pinned Locked Moved C#
csharplounge
24 Posts 9 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Christian Graus

    Well spotted. I found the whole thing far too hard to read, and I always like in the first instance to try to get these people to at least try to use the debugger before asking us to do their job for them. I am losing all faith in development as a respectable profession. I think I should become a plumber.

    Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

    S Offline
    S Offline
    Skymir
    wrote on last edited by
    #21

    Christian Graus wrote:

    I think I should become a plumber.

    I've been thinking electrician. Plumbing was an idea, but you end up having to deal with septic tanks and pipes clogged with things no one ever wants to know about.

    The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.

    1 Reply Last reply
    0
    • C Christian Graus

      Well spotted. I found the whole thing far too hard to read, and I always like in the first instance to try to get these people to at least try to use the debugger before asking us to do their job for them. I am losing all faith in development as a respectable profession. I think I should become a plumber.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      H Offline
      H Offline
      Henry Minute
      wrote on last edited by
      #22

      I wonder if you can help me? I've been trying to fit a new washer to my kitchen tap for some time. Should I use C# or VB.Net for this?

      Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

      OriginalGriffO 1 Reply Last reply
      0
      • H Henry Minute

        I wonder if you can help me? I've been trying to fit a new washer to my kitchen tap for some time. Should I use C# or VB.Net for this?

        Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #23

        Neither - it's a hardware problem...

        No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        1 Reply Last reply
        0
        • J J4amieC

          I thought it was going into an infinite loop because its looking for the next unique random number, and all possibilities have already been found. :confused:

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #24

          J4amieC wrote:

          I thought it was going into an infinite loop because its looking for the next unique random number, and all possibilities have already been found.

          In the following code:

          for (int i = 0; i < Quescnt; i++)
          {
          int RandomNumber = RandomClass.Next(28, 33);
          if (!Randomnos.ToString().Contains(RandomNumber.ToString() + ","))
          {
          Randomnos = Randomnos + RandomNumber.ToString() + ", ";
          }
          else
          {
          Quescnt++;
          }
          }

          every time it hits the else clause it is incrementing Quescnt so the for loop will keep going because Quescnt will always stay ahead of the loop variable.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups