- Home /
My Algorithm for checking whole tiles didint work
hello everyone ,
I have a game and this is the appearance and Rules of my game :
so accourding to the rules i have to check whole tiles status and check that is it possible for player to put another number or not , if he can put another number i should check which tiles are available for him/her , if a tile isn't available i will add a 1 inside that tile and if it is available i dont do anything or if there is 1 inside a available tile i should clear it so accourding to what i said i write this codes but this codes didnt work correctly :
private void CheckAndSetDes()
{
for (int i = 0; i < 48; i++)
{
if (MyLights[i].color == MyWhite)
{
if (i == 0)
{
CheckAndSetTwoSideDes(i + 1, i + 7 , i);
}
if (i == 6)
{
CheckAndSetTwoSideDes(i - 1, i + 7, i);
}
if (i == 42)
{
CheckAndSetTwoSideDes(i - 7, i + 1, i);
}
if (i == 48)
{
CheckAndSetTwoSideDes(i - 7, i - 1, i);
}
if (i >= 1 && i <= 5)
{
CheckAndSetThreeSideDes(i - 1, i + 1, i + 7, i);
}
if (i == 7 || i == 14 || i == 21 || i == 28 || i == 35)
{
CheckAndSetThreeSideDes(i - 7, i + 1, i + 7, i);
}
if (i == 13 || i == 20 || i == 27 || i == 34 || i == 41)
{
CheckAndSetThreeSideDes(i - 7, i - 1, i + 7, i);
}
if (i >= 43 && i <= 47)
{
CheckAndSetThreeSideDes(i - 1, i - 7, i + 1, i);
}
if ((i >= 8 && i <= 12) || (i >= 15 && i <= 19) || (i >= 22 && i <= 26) || (i >= 29 && i <= 33) || (i >= 36 && i <= 40))
{
CheckAndSetFourSideDes(i - 1, i + 7, i + 1, i + 7, i);
}
}
else
{
DesStatus[i] = 1;
}
}
}
private void CheckAndSetTwoSideDes(int FirstTile , int SecondTile , int MyMainNumber)
{
if ((MainNumber.color == MyRed) && (MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyGreen ||
MyLights[FirstTile].color == MyLightBlue ||
MyLights[FirstTile].color == MyBlue ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyGreen ||
MyLights[SecondTile].color == MyLightBlue ||
MyLights[SecondTile].color == MyBlue ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyOrange) && (MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyGreen ||
MyLights[FirstTile].color == MyLightBlue ||
MyLights[FirstTile].color == MyBlue ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyGreen ||
MyLights[SecondTile].color == MyLightBlue ||
MyLights[SecondTile].color == MyBlue ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyYellow) && (MyLights[FirstTile].color == MyGreen ||
MyLights[FirstTile].color == MyLightBlue ||
MyLights[FirstTile].color == MyBlue ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyGreen ||
MyLights[SecondTile].color == MyLightBlue ||
MyLights[SecondTile].color == MyBlue ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyLime) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyYellow ||
MyLights[FirstTile].color == MyBlue ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyYellow ||
MyLights[SecondTile].color == MyBlue ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyGreen) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyLightBlue) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyYellow ||
MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyYellow ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyBlue) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyYellow ||
MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyGreen ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyYellow ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyGreen))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyPink) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyYellow ||
MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyLightBlue ||
MyLights[FirstTile].color == MyGreen ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyYellow ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyLightBlue ||
MyLights[SecondTile].color == MyGreen))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyPurple) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyYellow ||
MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyLightBlue ||
MyLights[FirstTile].color == MyGreen ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyYellow ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyLightBlue ||
MyLights[SecondTile].color == MyGreen))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
}
private void CheckAndSetThreeSideDes(int FirstTile , int SecondTile , int ThirdTile, int MyMainNumber)
{
if ((MainNumber.color == MyRed) && (MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyGreen ||
MyLights[FirstTile].color == MyLightBlue ||
MyLights[FirstTile].color == MyBlue ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyGreen ||
MyLights[SecondTile].color == MyLightBlue ||
MyLights[SecondTile].color == MyBlue ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple ||
MyLights[ThirdTile].color == MyLime ||
MyLights[ThirdTile].color == MyGreen ||
MyLights[ThirdTile].color == MyLightBlue ||
MyLights[ThirdTile].color == MyBlue ||
MyLights[ThirdTile].color == MyPink ||
MyLights[ThirdTile].color == MyPurple))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyOrange) && (MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyGreen ||
MyLights[FirstTile].color == MyLightBlue ||
MyLights[FirstTile].color == MyBlue ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyGreen ||
MyLights[SecondTile].color == MyLightBlue ||
MyLights[SecondTile].color == MyBlue ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple ||
MyLights[ThirdTile].color == MyLime ||
MyLights[ThirdTile].color == MyGreen ||
MyLights[ThirdTile].color == MyLightBlue ||
MyLights[ThirdTile].color == MyBlue ||
MyLights[ThirdTile].color == MyPink ||
MyLights[ThirdTile].color == MyPurple))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyYellow) && (MyLights[FirstTile].color == MyGreen ||
MyLights[FirstTile].color == MyLightBlue ||
MyLights[FirstTile].color == MyBlue ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyGreen ||
MyLights[SecondTile].color == MyLightBlue ||
MyLights[SecondTile].color == MyBlue ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple ||
MyLights[ThirdTile].color == MyGreen ||
MyLights[ThirdTile].color == MyLightBlue ||
MyLights[ThirdTile].color == MyBlue ||
MyLights[ThirdTile].color == MyPink ||
MyLights[ThirdTile].color == MyPurple
))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyLime) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyYellow ||
MyLights[FirstTile].color == MyBlue ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyYellow ||
MyLights[SecondTile].color == MyBlue ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple ||
MyLights[ThirdTile].color == MyRed ||
MyLights[ThirdTile].color == MyOrange ||
MyLights[ThirdTile].color == MyYellow ||
MyLights[ThirdTile].color == MyBlue ||
MyLights[ThirdTile].color == MyPink ||
MyLights[ThirdTile].color == MyPurple))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyGreen) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple ||
MyLights[ThirdTile].color == MyRed ||
MyLights[ThirdTile].color == MyOrange ||
MyLights[ThirdTile].color == MyPink ||
MyLights[ThirdTile].color == MyPurple))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyLightBlue) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyYellow ||
MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyYellow ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple ||
MyLights[ThirdTile].color == MyRed ||
MyLights[ThirdTile].color == MyOrange ||
MyLights[ThirdTile].color == MyYellow ||
MyLights[ThirdTile].color == MyLime ||
MyLights[ThirdTile].color == MyPink ||
MyLights[ThirdTile].color == MyPurple))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyBlue) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyYellow ||
MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyGreen ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyYellow ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyGreen ||
MyLights[ThirdTile].color == MyRed ||
MyLights[ThirdTile].color == MyOrange ||
MyLights[ThirdTile].color == MyYellow ||
MyLights[ThirdTile].color == MyLime ||
MyLights[ThirdTile].color == MyGreen))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyPink) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyYellow ||
MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyLightBlue ||
MyLights[FirstTile].color == MyGreen ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyYellow ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyLightBlue ||
MyLights[SecondTile].color == MyGreen ||
MyLights[ThirdTile].color == MyRed ||
MyLights[ThirdTile].color == MyOrange ||
MyLights[ThirdTile].color == MyYellow ||
MyLights[ThirdTile].color == MyLime ||
MyLights[ThirdTile].color == MyLightBlue ||
MyLights[ThirdTile].color == MyGreen))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyPurple) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyYellow ||
MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyLightBlue ||
MyLights[FirstTile].color == MyGreen ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyYellow ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyLightBlue ||
MyLights[SecondTile].color == MyGreen ||
MyLights[ThirdTile].color == MyRed ||
MyLights[ThirdTile].color == MyOrange ||
MyLights[ThirdTile].color == MyYellow ||
MyLights[ThirdTile].color == MyLime ||
MyLights[ThirdTile].color == MyLightBlue ||
MyLights[ThirdTile].color == MyGreen))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
}
private void CheckAndSetFourSideDes(int FirstTile, int SecondTile, int ThirdTile , int FourthTile, int MyMainNumber)
{
if ((MainNumber.color == MyRed) && (MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyGreen ||
MyLights[FirstTile].color == MyLightBlue ||
MyLights[FirstTile].color == MyBlue ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyGreen ||
MyLights[SecondTile].color == MyLightBlue ||
MyLights[SecondTile].color == MyBlue ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple ||
MyLights[ThirdTile].color == MyLime ||
MyLights[ThirdTile].color == MyGreen ||
MyLights[ThirdTile].color == MyLightBlue ||
MyLights[ThirdTile].color == MyBlue ||
MyLights[ThirdTile].color == MyPink ||
MyLights[ThirdTile].color == MyPurple ||
MyLights[FourthTile].color == MyLime ||
MyLights[FourthTile].color == MyGreen ||
MyLights[FourthTile].color == MyLightBlue ||
MyLights[FourthTile].color == MyBlue ||
MyLights[FourthTile].color == MyPink ||
MyLights[FourthTile].color == MyPurple))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyOrange) && (MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyGreen ||
MyLights[FirstTile].color == MyLightBlue ||
MyLights[FirstTile].color == MyBlue ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyGreen ||
MyLights[SecondTile].color == MyLightBlue ||
MyLights[SecondTile].color == MyBlue ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple ||
MyLights[ThirdTile].color == MyLime ||
MyLights[ThirdTile].color == MyGreen ||
MyLights[ThirdTile].color == MyLightBlue ||
MyLights[ThirdTile].color == MyBlue ||
MyLights[ThirdTile].color == MyPink ||
MyLights[ThirdTile].color == MyPurple ||
MyLights[FourthTile].color == MyLime ||
MyLights[FourthTile].color == MyGreen ||
MyLights[FourthTile].color == MyLightBlue ||
MyLights[FourthTile].color == MyBlue ||
MyLights[FourthTile].color == MyPink ||
MyLights[FourthTile].color == MyPurple))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyYellow) && (MyLights[FirstTile].color == MyGreen ||
MyLights[FirstTile].color == MyLightBlue ||
MyLights[FirstTile].color == MyBlue ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyGreen ||
MyLights[SecondTile].color == MyLightBlue ||
MyLights[SecondTile].color == MyBlue ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple ||
MyLights[ThirdTile].color == MyGreen ||
MyLights[ThirdTile].color == MyLightBlue ||
MyLights[ThirdTile].color == MyBlue ||
MyLights[ThirdTile].color == MyPink ||
MyLights[ThirdTile].color == MyPurple ||
MyLights[FourthTile].color == MyGreen ||
MyLights[FourthTile].color == MyLightBlue ||
MyLights[FourthTile].color == MyBlue ||
MyLights[FourthTile].color == MyPink ||
MyLights[FourthTile].color == MyPurple))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyLime) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyYellow ||
MyLights[FirstTile].color == MyBlue ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyYellow ||
MyLights[SecondTile].color == MyBlue ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple ||
MyLights[ThirdTile].color == MyRed ||
MyLights[ThirdTile].color == MyOrange ||
MyLights[ThirdTile].color == MyYellow ||
MyLights[ThirdTile].color == MyBlue ||
MyLights[ThirdTile].color == MyPink ||
MyLights[ThirdTile].color == MyPurple ||
MyLights[FourthTile].color == MyRed ||
MyLights[FourthTile].color == MyOrange ||
MyLights[FourthTile].color == MyYellow ||
MyLights[FourthTile].color == MyBlue ||
MyLights[FourthTile].color == MyPink ||
MyLights[FourthTile].color == MyPurple))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyGreen) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple ||
MyLights[ThirdTile].color == MyRed ||
MyLights[ThirdTile].color == MyOrange ||
MyLights[ThirdTile].color == MyPink ||
MyLights[ThirdTile].color == MyPurple ||
MyLights[FourthTile].color == MyRed ||
MyLights[FourthTile].color == MyOrange ||
MyLights[FourthTile].color == MyPink ||
MyLights[FourthTile].color == MyPurple))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyLightBlue) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyYellow ||
MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyPink ||
MyLights[FirstTile].color == MyPurple ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyYellow ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyPink ||
MyLights[SecondTile].color == MyPurple ||
MyLights[ThirdTile].color == MyRed ||
MyLights[ThirdTile].color == MyOrange ||
MyLights[ThirdTile].color == MyYellow ||
MyLights[ThirdTile].color == MyLime ||
MyLights[ThirdTile].color == MyPink ||
MyLights[ThirdTile].color == MyPurple ||
MyLights[FourthTile].color == MyRed ||
MyLights[FourthTile].color == MyOrange ||
MyLights[FourthTile].color == MyYellow ||
MyLights[FourthTile].color == MyLime ||
MyLights[FourthTile].color == MyPink ||
MyLights[FourthTile].color == MyPurple))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyBlue) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyYellow ||
MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyGreen ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyYellow ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyGreen ||
MyLights[ThirdTile].color == MyRed ||
MyLights[ThirdTile].color == MyOrange ||
MyLights[ThirdTile].color == MyYellow ||
MyLights[ThirdTile].color == MyLime ||
MyLights[ThirdTile].color == MyGreen ||
MyLights[FourthTile].color == MyRed ||
MyLights[FourthTile].color == MyOrange ||
MyLights[FourthTile].color == MyYellow ||
MyLights[FourthTile].color == MyLime ||
MyLights[FourthTile].color == MyGreen))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyPink) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyYellow ||
MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyLightBlue ||
MyLights[FirstTile].color == MyGreen ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyYellow ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyLightBlue ||
MyLights[SecondTile].color == MyGreen ||
MyLights[ThirdTile].color == MyRed ||
MyLights[ThirdTile].color == MyOrange ||
MyLights[ThirdTile].color == MyYellow ||
MyLights[ThirdTile].color == MyLime ||
MyLights[ThirdTile].color == MyLightBlue ||
MyLights[ThirdTile].color == MyGreen ||
MyLights[FourthTile].color == MyRed ||
MyLights[FourthTile].color == MyOrange ||
MyLights[FourthTile].color == MyYellow ||
MyLights[FourthTile].color == MyLime ||
MyLights[FourthTile].color == MyLightBlue ||
MyLights[FourthTile].color == MyGreen))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
if ((MainNumber.color == MyPurple) && (MyLights[FirstTile].color == MyRed ||
MyLights[FirstTile].color == MyOrange ||
MyLights[FirstTile].color == MyYellow ||
MyLights[FirstTile].color == MyLime ||
MyLights[FirstTile].color == MyLightBlue ||
MyLights[FirstTile].color == MyGreen ||
MyLights[SecondTile].color == MyRed ||
MyLights[SecondTile].color == MyOrange ||
MyLights[SecondTile].color == MyYellow ||
MyLights[SecondTile].color == MyLime ||
MyLights[SecondTile].color == MyLightBlue ||
MyLights[SecondTile].color == MyGreen ||
MyLights[ThirdTile].color == MyRed ||
MyLights[ThirdTile].color == MyOrange ||
MyLights[ThirdTile].color == MyYellow ||
MyLights[ThirdTile].color == MyLime ||
MyLights[ThirdTile].color == MyLightBlue ||
MyLights[ThirdTile].color == MyGreen ||
MyLights[FourthTile].color == MyRed ||
MyLights[FourthTile].color == MyOrange ||
MyLights[FourthTile].color == MyYellow ||
MyLights[FourthTile].color == MyLime ||
MyLights[FourthTile].color == MyLightBlue ||
MyLights[FourthTile].color == MyGreen))
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = "1";
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
else
{
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().text = string.Empty;
MyDestinations[MyMainNumber].GetComponentInChildren<Text>().color = MyWhite;
MyLights[MyMainNumber].color = MyWhite;
}
}
private bool ReturnGameStatusFinished()
{
int counter = 0;
for (int i = 0; i < DesStatus[i]; i++)
{
if (DesStatus[i] == 1)
{
counter = counter + 1;
}
else
{
continue;
}
}
if (counter == 49)
{
return true;
}
else
{
return false;
}
}
so could you help me to fix this problem.
in fact in my game i will create a random number between 1 to 9 with a random color and i want to check that is it possible for player to put that number or not accouding to the rules for example if the random number color is red and the player want to put that number inside tile 1 then i should check color rule for tile number 2 and 8 and if the color of that two tiles are in the same color group of random number i will let player to put that number inside that tile but for example if the color of tile 2 was green i should put a 1 inside tile 1 to show that , this tile is not available.
so please help me to fix this problem i check 5 diffrent ways but none of them work.