Hello forum,
I’m creating a memory game with an opponent that perfectly remembers certain cards opened by either the AI or the player. Will release full code if I manage to make it work.
Thing is, it has one major flaw:
private IEnumerator AITurnCard(int Idx, float Delay)
{
yield return new WaitForSeconds(Delay);
if (Choice.Count > 0)
{
Debug.Break();
while (Deck[Idx]==Choice[0])
{
Debug.Log("Detected a faulty selection");
Idx = Random.Range(0, Deck.Count);
yield return null;
}
}
Deck[Idx].GetComponent<Card>().Choose();
}
The opponent draws a random card from available from the deck but sometimes, it wants to flip the same card as the first one/choice. I have multiple variables and while loops checking so it doesn’t happen, and yet, the debug.log doesn’t appear. Does anyone know what’s going on?
Thanks in advance.