This section of my code keeps coming up with a local function error, but i can't find any braces that aren't closed. Any help is greatly appreciated!
PS. Yes, it is suppossed to be an infinite loop.Code:
while (1)
{
printf("What would you like to do next (1 - turn car on; 2 - turn car off; 3 - change position of car)?");
scanf ("%d", &selectedOption);
switch (selectedOption)
{
case 1:
int IgnitionOn (int stateOfIgnition);
break;
case 2:
int IgnitionOff(int stateOfIgnition);
void StateOfCar(int stateOfIgnition, int currentHorizontalPosition, int currentVerticalPosition, char color);
break;
case 3:
printf("Would you like to move the car 1 - horizontally or 2 - vertically?\n");
scanf("%d", &direction);
switch (direction)
{
case 4:
printf("How many horizontal spaces would you like to move the car? (- to move left, positive to move right");
scanf("%d", &horizontalSpaces);
int MoveHorizontally (int horizontalSpaces, int currentHorizontalPosition);
void StateOfCar(int stateOfIgnition, int currentHorizontalPosition, int currentVerticalPosition, char color);
break;
case 5:
printf("How many vertical spaces would you like to move the car? (positive to move up, negative to move down)");
scanf("%d", &verticalSpaces);
int MoveVertically(int verticalSpaces, int currentVerticalPosition);
void StateOfCar(int stateOfIgnition, int currentHorizontalPosition, int currentVerticalPosition, char color);
break;
}
break;
}
return 0;
}
char ColorAssignment(char color)
{
srand (time (NULL));
switch ( rand() % 5 )
{
case 0: color = 'R';
break;
case 1: color = 'G';
break;
case 2: color = 'B';
break;
case 3: color = 'W';
break;
case 4: color = 'S';
break;
}}
return color;
}