I need help with project

#include <Wire.h> //
#include <SparkFunSX1509.h> //
#include <FastLED.h>
#include <SevSeg.h>

bool match = false; // declare a booelan variable. Default is false. If there is a match, it becomes true
int wrong = 0;
int extra = 0;
int count = 0;
int i, H = 0, T = 0 , Z = 0 , key;
char LEDpins[5][5] = {
{'a', 'b', 'c', 'd', 'e'},
{'f', 'g', 'h', 'i', 'j'},
{'k', 'l', 'm', 'n', 'o'},
{'p', 'q', 'r', 's', 't'},
{'u', 'v', 'w', 'x', 'y'},
};

int randomNumber[5]; //a variable to hold a random number

const byte SX1509_ADDRESS = 0x3E; // SX1509 I2C address (00)
SX1509 io; // Create an SX1509 object

#define KEY_ROWS 5
#define KEY_COLS 5

// Handy array we'll use to map row/column pairs to
// character values:
char keyMap[KEY_ROWS][KEY_COLS] = {
{'a', 'b', 'c', 'd', 'e'},
{'f', 'g', 'h', 'i', 'j'},
{'k', 'l', 'm', 'n', 'o'},
{'p', 'q', 'r', 's', 't'},
{'u', 'v', 'w', 'x', 'y'},
};

// ARDUINO pin 2 connected to SX1509 interrupt
#define INTERRUPT_PIN 2
#define LED_PIN 7
#define NUM_LEDS 25
CRGB leds[NUM_LEDS];

const int buzzer = 13; //buzzer to arduino pin 13

#include "SevSeg.h"
SevSeg sevseg;

void setup() {

randomSeed(analogRead(A0)); //generate a random seed
Serial.begin(9600); //start serial communication

// What is all these line below for?
/////////////////////////////////////////////////////////////////////////
for (int a = 0; a < 5; a++)
{
pinMode(LEDpins[a], OUTPUT); //set LED as output
}

for (int b = 0; b < 5; b++)
{
pinMode(LEDpins[b], OUTPUT); //set LED as output
}

uint8_t x[25];

for (size_t i = 0; i < 25; i++)
x[i] = i + 1;

for (size_t i = 0; i < 25; i++)
{
size_t j = random(i, 25);

// swap x[i] and x[j]
auto t = x[i];
x[i] = x[j];
x[j] = t;

}
////////////////////////////////////////////////////////////////////////

if (!io.begin(SX1509_ADDRESS))
{
Serial.println("Failed to communicate.");
while (1);
}

// defining scan time, debounce time, and sleep time:
// Sleep time range: 128 ms - 8192 ms (powers of 2) 0=OFF
unsigned int sleepTime = 0;
// Scan time range: 1-128 ms, powers of 2
byte scanTime = 32 ; // Scan time per row, in ms
// Debounce time range: 0.5 - 64 ms (powers of 2)
byte debounceTime = 96; // Debounce time
io.keypad(KEY_ROWS, KEY_COLS, sleepTime, scanTime, debounceTime);

// Set the ARDUINO pin as an input, to monitor the interrupt
pinMode(INTERRUPT_PIN, INPUT_PULLUP);
Serial.println("Row | Col | Key"); 6;

FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);

pinMode(buzzer, OUTPUT); // Set buzzer - pin 13 as an output

byte numDigits = 1;
byte digitPins = {};
byte segmentPins = {12, 11, 10, 6, 5, 4, 8, 9};
bool resistorsOnSegments = true;

byte hardwareConfig = COMMON_CATHODE;
sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments);
sevseg.setBrightness(90);

} //End of void setup

void loop() {

// 1. Generate random lights on the LED
FastLED.clear();
for (i = 0; i < 5; i++)
{
randomNumber[i] = (random(0, 24));
leds[randomNumber[i]] = CRGB(10, 10, 10);
delay(50);
}
FastLED.show();

// KP: Print out the random numbers you generated to check
for (i = 0; i < 5; i++)
{
Serial.println(randomNumber[i]);
}

// 2. Clear the lights and start the games
delay(6000);
FastLED.clear(); //
FastLED.show();
wrong = 0;
count = 0;

while ( count < 5 && wrong == 0) // This while loop is to check if all 5 keys are pressed correctly. If you press wrongly (wrong=0), game ends immediately, otherwise you move on to next stage.
{
// 3. Read
// If the interrupt pin goes active-low, a keypad button
// is begin pressed:
while (digitalRead(INTERRUPT_PIN));

count++;
// Use readKeypad() to get a binary representation for
// which row and column are pressed
unsigned int keyData = io.readKeypad();

// Use the getRow, and getCol helper functions to find
// which row and column keyData says are active.
byte row = io.getRow(keyData);
byte col = io.getCol(keyData);
char key = keyMap[row][col];
Serial.print(String(row) + " | " + String(col) + " | ");
Serial.println(key);


// 4. Check and score
key = key - 97;

Serial.print("I pressed: ");
Serial.println(key, DEC);

for (int i = 0; i < 5; i++) //  You are looping 5 times and checking if there is a match between the CURRENT KEY and the elements in the random number array.
{
  Serial.print("Compare Key ");
  Serial.print(key);
  Serial.print(" with ");
  Serial.print(randomNumber[i]);
  Serial.print(" : ");

  if (key == randomNumber[i])
  {
    Serial.println("Match!");
    match = true;// found a match. Set this flag to tell your program that it found match!
    leds[randomNumber[i]] = CRGB(0, 10, 0);
    FastLED.show();
    randomNumber[i] = 999; // change array to 999
    break;  // No need to check the rest of the array anymore. Break out of for loop immediately
  }
  else
  {
    Serial.println("No match. Checking key with the next element in the array");
  }
} // end for loop


if (match == true)
{
  match = false;  // reset match back to false
  // What do you want to do if the current key you press match the one of the random numbers??
}
else  //what you press does not match what is in the array of 5 numbers you generated
{
  leds[key] = CRGB(10, 0, 0);
  for (i = 0; i < 5; i++)
  {

    leds[randomNumber[i]] = CRGB(0, 10, 0);
    delay(50);
  }
  FastLED.show();
  Serial.println("You pressed wrongly: ");
  Serial.println(key);
  Serial.println("Try Again");
  tone(buzzer, 1000); // Send 1KHz sound signal...
  delay(1000);        // ...for 1 sec
  noTone(buzzer);     // Stop sound...
  delay(1000);        // ...for 1sec
  wrong = 1;  // end the game immediately
}

}//while loop

if (wrong == 1) // you made a mistake. What do you want to do?
{
wrong = 0; // reset wrong back to zero again.
Serial.println("You lose. Try again!");
T = 0; //reset players score ,T , to 0
// what else do you want to do here?
}
else // you successful clear all 5 leds without making a mistake. What do you want to do? We would compare current players score, T, to the high score, H.
{
Serial.println("Congrats. You got all 5 matches");
// What else do you want to do here?

T++;
if (T > H) {
  H = T;
}

Serial.println("Your score is : "); //display players current score ,T
Serial.println(T);

Serial.println("The high score is : "); // display high score ,H
Serial.println(H);

}
sevseg.setNumber(T);
sevseg.refreshDisplay();
delay(3000);
sevseg.setNumber(H);
sevseg.refreshDisplay();
delay(1000);
Serial.println("Start next round!");
delay(2000);

} // void loop

I need help with my project. So basically this is a toy that make 5 different random LED light up in a 5 by 5 matrix LED strip. Then we need to use the 5 by 5 keypad to input the the exact position where the LED lights up. Now the only problem with the code is that my 5 random LED is not really random. There may be some times where a number will repeat twice. Lets say the 5 random numbers are '0, 6, 10, 10, 24'. However what i want is '1, 8, 11, 19, 21'. Anyone can help me with this please?

Hello, do yourself a favour and please read How to get the best out of this forum and modify your post accordingly (including code tags and necessary documentation of your ask).

Why the same pins twice?

Edit:

char LEDpins[5][5] = {
{'a', 'b', 'c', 'd', 'e'},
{'f', 'g', 'h', 'i', 'j'},
{'k', 'l', 'm', 'n', 'o'},
{'p', 'q', 'r', 's', 't'},
{'u', 'v', 'w', 'x', 'y'},
};

This is nonsense

So you want to make sure that the random numbers don't repeat?

  for (i = 0; i < 5; i++)
  {
    boolean isADuplicate = false;
    int r = 0;
    do
    {
      r = random(25);
      isADuplicate = false;
      for (int j = 0; j < i; j++)
      {
        if (r == randomNumber[j])
        {
          isADuplicate = true;
          break;
        }
      }
    }
    while (isADuplicate);
    randomNumber[i] = r;
    leds[randomNumber[i]] = CRGB(10, 10, 10);
    delay(50);
  }

You should get together with this person

Srsly, you haven’t even bothered to figure out how to post code here.

a7

I hate it when that happens.

Grrrrr.

byte digitPins []= {};

Oops