Noob C# programmer needing help

Discussion in 'Programming General' started by ryanb415, Oct 14, 2012.

Noob C# programmer needing help
  1. Unread #1 - Oct 14, 2012 at 11:04 AM
  2. ryanb415
    Joined:
    Aug 9, 2012
    Posts:
    27
    Referrals:
    0
    Sythe Gold:
    1

    ryanb415 Member
    Banned

    Noob C# programmer needing help

    I am currently working on a program that is Event based. (it's a form application)
    it is a number guessing game, I'm having no issue creating the random variable, however, Every time I click the button the number changes, I am wondering if there is a way to store the first number that the random number creates. Any help would be greatly appreciated
     
  3. Unread #2 - Oct 16, 2012 at 5:49 AM
  4. iJava
    Joined:
    Nov 21, 2011
    Posts:
    1,197
    Referrals:
    11
    Sythe Gold:
    485
    Discord Unique ID:
    220055593568829441

    iJava .Previously known as RSGoldRush
    $200 USD Donor New

    Noob C# programmer needing help

    Just above the code that changes the number, store the variable if it's the first as an Integer, alternatively you could store them in an array.
     
  5. Unread #3 - Nov 13, 2012 at 7:36 PM
  6. Blupig
    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant

    Blupig BEEF TOILET
    $5 USD Donor

    Noob C# programmer needing help

    int firstnumber;
    int isFirstClick = true;
    int randomnumber;

    private button click event blah blah(){

    if (isfirstclick == true)
    {
    isfirstclick = false;
    firstnumber = genRandom();
    return;
    }

    randomnumber = genRandom();

    }


    Something like that
     
< Listen .v2m module music in VB .NET | I will be taking computer programming in college (Look) >

Users viewing this thread
1 guest


 
 
Adblock breaks this site