2 random numbers??

how would you code the following:

code selects 2 random numbers..

first number has to be from 1-6.. keep this in memory until game is reset

and the second number has to be 1-2 - (there are 2 bi-color leds, 1 of the leds will light up if #1 is generated and the other led will light up if #2 is generated

int first;
int second;

void setup()
{
  first = random(6) + 1;
  second = random(2) + 1;
}

void loop()
{
}

keep this in memory until game is reset
how do you reset the game?

(there are 2 bi-color leds, 1 of the leds will light up if #1 is generated and the other led will light up if #2 is generated
don't understand, please elaborate

ok,

reset is done by pressing a tactile button.. will turn off the 2 bi-color leds and re-generate the 2 random numbers

2 - 5mm bi-color leds (red/green.. 1 for each player).. we won't worry about the red for now..

so, game starts by generating a random number (1 OR 2), if 1 is chosen then the first led will light up green.. if 2 is chosen then the other led will light up green

anyone?

Post the code you have written as an attempt to solve your problem (in </> 'code' tags)
and you will probably get help in removing problems, depending on your effort.

Have a look at #7 of How to use this forum

Delta_G:
You've been shown how to get the two random numbers. I think writing a couple of it statements to turn on one led or the other based on those is an elementary exercise for you. If you're not willing to put in at least that small tiny effort then I doubt anyone here will give you anymore code.

Maybe it isn't an 'elementary exercise', and a 'small tiny effort' for 'insignia'.

Since there will obviously be a lot more to be written in this program, I don't mind giving an example of how this part could be achieved, to get the ball rolling:-

// Constants:-
const byte pButton = 2;                     // Pushbutton on pin2, active-low.
const byte led1Green = 3;                   // First green LED on pin 3.
const byte led2Green = 4;                   // Second green LED on pin 4.

// Variables:-
byte first;                                 // Will hold a random number between 1 and 6.
byte second;                                // Will hold a random number between 1 and 2.
//char szResult[30];                        // * Uncomment this for serial monitoring of 'random' results.
unsigned long prevMillis;

void setup()
{
    pinMode(pButton, INPUT_PULLUP);         // Internal pullup resistor enabled on button.
    pinMode(led1Green, OUTPUT);             // Lights if 'second' is 1.
    pinMode(led2Green, OUTPUT);             // Lights if 'second' is 2.
//    Serial.begin(115200);                 // * Uncomment this for serial monitoring of 'random' results.
}

void loop()
{
    while (digitalRead(pButton)){}          // Wait for a button press.
    first = random(6) + 1;                  // Generate a random number between 1 and 6.
    second = random(2) + 1;                 // Generate a random number between 1 and 2.

    // Format then send the result to the serial monitor:-
    // (* Uncomment the following two lines for serial monitoring of 'random' results.)
//    sprintf(szResult,"first = %d,\tsecond = %d",first,second);
//    Serial.println(szResult);

    // Light the LEDs accordingly:-
    if (second == 1)
    {
        digitalWrite(led1Green, HIGH);
        digitalWrite(led2Green, LOW);
    }
    else
    {
        digitalWrite(led1Green, LOW);
        digitalWrite(led2Green, HIGH);
    }

    prevMillis = millis();                  // Provide a 50mS delay for crude button debounce.
    while (millis() - prevMillis < 50){}   //    "    "  "     "    "    "       "
}

sorry, had to go back to work last night after a week off of vacation time so i had to go to bed early to get back into the routine..

i had already mentioned in another post that my son took the arduino out to a friends house so they could work on project and i can't get my CH340 clone to work.. the new funduino should be in today or tomorrow.. so, no point in me trying to write code until it arrives.. i was just curious as to how it was done.. and yes, there will be a lot more written to it..

i'm so hoping it arrives today.. ebay says by tomorrow.. we shall see i guess

first = random(6) + 1;
second = random(2) + 1;

that's almost like VB... ALMOST, there's a little bit more to it in vb