Пример #1
0
        public FrameScore AutoBowl()
        {
            var bowl1 = GenerateBowl(RemainingPins);

            RemainingPins -= bowl1;
            var frame = new FrameScore()
            {
                Bowl1 = bowl1
            };

            if (RemainingPins > 0)
            {
                var bowl2 = GenerateBowl(RemainingPins);
                frame.Bowl2    = bowl2;
                RemainingPins -= bowl2;
                if (RemainingPins == 0)
                {
                    frame.Spare = true;
                }
                else
                {
                    frame.TotalScore = 10 - RemainingPins;
                }
            }
            else
            {
                frame.Strike = true;
            }
            return(frame);
        }
Пример #2
0
        public FrameScore ManualBowl()
        {
            Console.WriteLine($"Enter your first bowl score for frame {CurrentFrame + 1}");
            var bowl1 = OptionChooser(Console.ReadLine());

            RemainingPins -= bowl1;
            var frame = new FrameScore()
            {
                Bowl1 = bowl1
            };

            if (RemainingPins > 0)
            {
                Console.WriteLine($"Enter your second bowl score for {CurrentFrame + 1}");
                var bowl2 = OptionChooser(Console.ReadLine());
                frame.Bowl2    = bowl2;
                RemainingPins -= bowl2;
                if (RemainingPins == 0)
                {
                    frame.Spare = true;
                }
                else
                {
                    frame.TotalScore = 10 - RemainingPins;
                }
            }
            else
            {
                frame.Strike = true;
            }
            return(frame);
        }