15,959,717 members
See more:
```int ledPins[7]={2,3,4,5,6,7,8};
int dicePatterns[7][7]= {
{0,0,0,0,0,0,1}, //1
{0,0,1,1,0,0,0}, //2
{0,0,1,1,0,0,1}, //3
{1,0,1,1,0,1,0}, //4
{1,0,1,1,0,1,1}, //5
{1,1,1,1,1,1,0}, //6
{0,0,0,0,0,0,0}, // En blanco
};

int switchPin=9;
int blank=6;

void setup()
{
for(int i=0;i<7;i++)
{
pinMode(ledPins[i],OUTPUT);
digitalWrite(ledPins[i],LOW);
}
}

void loop();
{
{
rollTheDice();
}
delay(100);
}

void rollTheDice();
{
int result=0;
int lengthOfRoll=random(15,25);
for (int i=0;i<lengthofroll;i++)

{
="" result="random(0,6);" resultado="" sera="" de="" 0="" a="" 5="" no="" 1="" 6
="" show(result);
="" delay(50+i*10);
="" }
="" for="" (int="" j="0;j<3;j++)
" show(blank);
="" delay(500);
="" }
}

void="" show(int="" result)
{
="" for(int="" i="0;i<7;i++)
" digitalwrite(ledpins[i],="" dicepatterns[result][i]);
="" }
}

<b="">What I have tried:

Ya he buscado en internet y con mis compañeros de curso y no encontramos donde esta el error.```
Posted
Updated 6-Oct-22 18:29pm

## Solution 1

C
```void loop();
^
|
{
{
rollTheDice();
}
delay(100);
}```
What is the semicolon doing there?
The line
`void loop();`
is a forward declaration, and can't be followed by a function body because you added a semicolon. Take it away, and that problem will go as well. Now check all your other functions as well ...

You should expect to get syntax errors every day, probably many times a day while you are coding - we all do regardless of how much experience we have! Sometimes, we misspell a variable, or a keyword; sometimes we forget to close a string or a code block. Sometimes the cat walks over your keyboard and types something really weird. Sometimes we just forget how many parameters a method call needs.

We all make mistakes.

And because we all do it, we all have to fix syntax errors - and it's a lot quicker to learn how and fix them yourself than to wait for someone else to fix them for you! So invest a little time in learning how to read error messages, and how to interpret your code as written in the light of what the compiler is telling you is wrong - it really is trying to be helpful!

So read this: How to Write Code to Solve a Problem, A Beginner's Guide Part 2: Syntax Errors[^] - it should help you next time you get a compilation error!