Pseudo-code help...

I am new to coding and I would appreciate it if someone could translate this to Pseudo-code so I could understand each line.
(This was taken from: A Simple Simon Says Game | Arduino Project Hub)

const int MAX_LEVEL = 100;
int sequence[MAX_LEVEL];
int your_sequence[MAX_LEVEL];
int level = 1;

int velocity = 1000;

void setup() {
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(A2, INPUT);
pinMode(A3, INPUT);

pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);

digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
}

void loop()
{
if (level == 1)
generate_sequence();//generate a sequence;

if (digitalRead(A4) == LOW || level != 1) //If start button is pressed or you're winning
{
show_sequence(); //show the sequence
get_sequence(); //wait for your sequence
}
}

void show_sequence()
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);

for (int i = 0; i < level; i++)
{
digitalWrite(sequence*, HIGH);*
delay(velocity);
digitalWrite(sequence*, LOW);*
delay(200);
}
}
void get_sequence()
{
int flag = 0; //this flag indicates if the sequence is correct
for (int i = 0; i < level; i++)
{
flag = 0;
while(flag == 0)
{
if (digitalRead(A0) == LOW)
{
digitalWrite(5, HIGH);
your_sequence = 5;
flag = 1;
delay(200);
if (your_sequence != sequence*)*
{
wrong_sequence();
return;
}
digitalWrite(5, LOW);
}
if (digitalRead(A1) == LOW)
{
digitalWrite(4, HIGH);
your_sequence = 4;
flag = 1;
delay(200);
if (your_sequence != sequence*)*
{
wrong_sequence();
return;
}
digitalWrite(4, LOW);
}
if (digitalRead(A2) == LOW)
{
digitalWrite(3, HIGH);
your_sequence = 3;
flag = 1;
delay(200);
if (your_sequence != sequence*)*
{
wrong_sequence();
return;
}
digitalWrite(3, LOW);
}
if (digitalRead(A3) == LOW)
{
digitalWrite(2, HIGH);
your_sequence = 2;
flag = 1;
delay(200);
if (your_sequence != sequence*)*
{
wrong_sequence();
return;
}
digitalWrite(2, LOW);
}
}
}
right_sequence();
}
void generate_sequence()
{
randomSeed(millis()); //in this way is really random!!!
for (int i = 0; i < MAX_LEVEL; i++)
{
sequence = random(2,6);
}
}
void wrong_sequence()
{
for (int i = 0; i < 3; i++)
{
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
delay(250);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
delay(250);
}
level = 1;
velocity = 1000;
}
void right_sequence()
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
delay(250);
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
delay(500);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
delay(500);
if (level < MAX_LEVEL);
level++;
velocity -= 50; //increase difficulty
}

DankMeymeys:
I am new to coding and I would appreciate it if someone could translate this to Pseudo-code so I could understand each line.

If you're new to coding, you should start with a simpler example. There are plenty of them built into the Arduino IDE: File --> Examples.

I bet that the original code did not have italics in it. Code tags would have avoided this problem.

Besides, one of the "if" statements has a semicolon in an unusual place.

And some of the indexing is missing from the arrays.

if (your_sequence != sequence) ??

This code does not work and is not that well constructed. Start smaller. Here is a pseudo code homework assignment you can do just by building the simple examples as recommended already.

  1. Blink an LED. Learn what digitalWrite() and delay() does.
  2. Blink it a specified number of times. Learn what a for(,,) loop does.
  3. Blink an LED when a button is pressed. Learn what digitalRead() and if() conditional code does.
  4. Learn to use numbers in an array. Learn what sequence[MAX_LEVEL] means

With this background you should be able to start documenting this code (and repairing it to actually work) all by yourself. Come back then if you still can't understand some small concept and I know plenty of people will help you out.

DankMeymeys:
I am new to coding and I would appreciate it if someone could translate this to Pseudo-code so I could understand each line.

If you study that program for an hour or two or three and use Google I suspect you will have a pretty good idea what most of the lines do.

Maybe there will be one or two pieces that remain unclear. If so ask specific questions about them, bit don't expect someone to write unnecessary explanations.

...R

And some of the indexing is missing from the arrays.

if (your_sequence != sequence) ??

The array index is probably there in the original code but as it uses i as its index variable this has been interpreted as italics by the HTML renderer in the browser, hence the advice to use code tags to avoid the problem.