#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#define LED_R 0
#define LED_G 1
#define LED_B 2
#define ON   (1)
#define OFF  (0)

int Roll_Dice(void);
void Change_Ledcolor(void);
int led_state;
int sw1flg,sw2flg,sw3flg,sw4flg,sw5flg;
  
void main(void)
{
	Change_Ledcolor();
}

void Change_Ledcolor(void)
{
  if(sw1flg == ON){
    if(sw2flg == ON){
      if(sw3flg == ON){
        if(sw4flg == ON){
          if(sw5flg == ON){
            printf("Switch_ON\n");
            switch(led_state)  {
              case(LED_R):
                if(dice_value2 == 1){
                  led_state = LED_G;
                }
                else if (dice_value2 == 2){
                  led_state = LED_B;
                }
                else{
                  printf("NO_COLOR_CHANGE\n");
                }
                break;
              case(LED_G):
                if(dice_value2 == 1){
                  led_state = LED_B;
                }
                else if (dice_value2 == 2){
                  led_state = LED_R;
                }
                else{
                  printf("NO_COLOR_CHANGE\n");
                }
                break;

              case(LED_B):
                if(dice_value2 == 1){
                  led_state = LED_R;
                }
                else if (dice_value2 == 2){
                  led_state = LED_G;
                }
                else{
                  printf("NO_COLOR_CHANGE\n");
                }
                break;
                default:
                  printf("NO_COLOR\n");
                }
              }
            }
        }
    }
  }
}

int Roll_Dice(void)
{
  int value;
  srand(time(NULL));
  value = rand()%6+1;
  return value;
}

