Example #1
0
        public bool guess(int[] x, out int score1, out int score2, ref int credits)
        {
            score1 = 0;
            score2 = 0;
            i++;

            if (i <= 10)
            {
                for (int i = 0; i < 4; i++)
                {
                    if (x[i] == secretcomb[i])
                    {
                        score1++;
                    }
                    else if (secretcomb.Contains(x[i]))
                    {
                        score2++;
                    }
                }

                if (score1 == 4 && score2 == 0)
                {
                    return(true);
                }
                if (score1 + score2 >= 3)
                {
                    credits -= 5;
                }
                else if (score1 + score2 >= 1)
                {
                    credits -= 10;
                }
                else if (score1 + score2 == 0)
                {
                    credits -= 15;
                }
            }
            else
            {
                YouLost?.Invoke("You lost, the Combo was: " + string.Join(",", secretcomb) + " and your credits are: " + credits);
            }


            return(false);
        }
Example #2
0
 public void OnYouLost(IObjectConnection connection, YouLost lost)
 {
     Console.Clear();
     Console.WriteLine("You lost.");
 }