Exemplo n.º 1
0
        //make private TODODODODODODODODODO
        public int MultiplesType(string[] multiples, int seconds)
        {
            List <string> answerList = new List <string>();
            int           score      = 0;
            DateTime      instant;
            string        time;
            DateTime      now = DateTime.Now;

            Station.Write("\n\nType a multiple that is not above");
            do
            {
                if (answerList.Count == 17)
                {
                    break;
                }

                Console.Clear();
                Station.Write("you Have typed : ");
                foreach (var item in answerList)
                {
                    Station.Write(item + ", ");
                }

                Station.WriteLine("\n\nyour current score is " + score.ToString() + "\n");
                instant = DateTime.Now;
                time    = Station.TimeDifference(now).ToString();
                Station.WriteLine("You have used : " + time + " Seconds");

                string answer = Station.Read();

                if (multiples.Contains(answer) && !answerList.Contains(answer))
                {
                    answerList.Add(answer);
                    score++;
                }
                else
                {
                    Station.WriteLine("Nope try again");
                    //score--;
                }
            } while (true);

            int timeInt = Station.TimeDifference(now);

            if (timeInt > seconds)
            {
                return(-1);
            }
            else
            {
                return(score);
            }
        }