Unable to Visually return the Column Num

int ColumnPins = 4; //How many column pins
int RowPins = 5; //How many row pins
int Columns = {0, 1, 2, 3}; //Column pinNumbers
int Rows = {4, 6, 7, 8, 9}; //Row pinNumbers

void setup()
{
pinMode(13, OUTPUT);
for (int counter = 0; counter < ColumnPins; counter++)
{ //set all the columns to output
pinMode(Columns[counter], OUTPUT);
}
for (int counter = 0; counter < RowPins; counter++)
{ //set all rows to input
pinMode(Rows[counter],INPUT_PULLDOWN);
}
}

void loop()
{
for (int ColumnIndex = 0; ColumnIndex < ColumnPins; ColumnIndex++) //sets column pins to high 1 by 1
{
digitalWrite(Columns[ColumnIndex], HIGH);
RowScan(ColumnIndex); //calls function rowscan checks whether and row is HIGH
}
}

void RowScan(int ColumnIndex) //Scans each rowpin and checks whether any reads high
{
for (int RowIndex = 0; RowIndex < RowPins; RowIndex++)
{
if (digitalRead(Rows[RowIndex]) == HIGH) //if Rows at rowindex is high
{
for (int blinks = 0; blinks <= RowIndex; blinks++)
{ //Outputs # of blinks based on which row HIGH was read
// print index
digitalWrite(13, HIGH); //LEDPIN high
delay(250);
digitalWrite(13, LOW);
delay(500);
}
for (int blinks = 0; blinks <= ColumnIndex; blinks++)
{ //Outputs # of blinks based on which row HIGH was read
// print index
digitalWrite(13, HIGH); //LEDPIN high
delay(100);
digitalWrite(13, LOW);
delay(100);
}
}
else if (digitalRead(Rows[RowIndex]) == LOW) //Rows at index o is LOW
{
digitalWrite(13,LOW);
}
}
}

i believe the issue specifically lies within the for loop

Which one? The one in loop() or the one in RowScan()?

The RowScan() function has no idea which column is active, so you can't expect it to "visually output the column number", whatever that means.

You lied when you said that RowScan would return an int. Why?

RowScan SHOULD return an int - the row that is active, or -1 if none. Then, loop() would know what column and what row was selected.

void setup() 
{
  for (int counter = 0; counter < ColumnPins; counter++) 
  { //set all the columns to output
    pinMode(Columns[counter], OUTPUT);
  }
}

Shouldn’t you set the pins to LOW, just in case?

void loop()
{
  for (int ColumnIndex = 0; ColumnIndex < ColumnPins; ColumnIndex++) //sets column pins to high 1 by 1 
  {
    digitalWrite(Columns[ColumnIndex], HIGH);
    RowScan(ColumnIndex); //calls function rowscan checks whether and row is HIGH 
  }
}

Shouldn’t you set the column pin back to LOW before going on to the next column?

Yes ^ that may be an issue I overlooked will change tonight