コード例 #1
0
ファイル: Program.cs プロジェクト: vktewthia/bowlingsummer
        private static AbstractFrame GetInput(short frameIndex)
        {
            AbstractFrame frame = null;

            Console.WriteLine("Input for Frame-{0} ", frameIndex);
            Bowl bowl1 = RollFirstBowl();
            Bowl bowl2 = RollSecondBowl(bowl1, frameIndex);

            frame = new Frame(bowl1, bowl2, frameIndex);

            if (frameIndex == 10 && (frame.IsStrike || frame.IsSpare))
            {
                Bowl bowl3 = RollThirdBowl(bowl2);
                frame = new LastFrame(bowl1, bowl2, bowl3, frameIndex);
            }

            return frame;
        }
コード例 #2
0
        private static AbstractFrame GetInput(short frameIndex)
        {
            AbstractFrame frame = null;

            Console.WriteLine("Input for Frame-{0} ", frameIndex);
            Bowl bowl1 = RollFirstBowl();
            Bowl bowl2 = RollSecondBowl(bowl1, frameIndex);

            frame = new Frame(bowl1, bowl2, frameIndex);

            if (frameIndex == 10 && (frame.IsStrike || frame.IsSpare))
            {
                Bowl bowl3 = RollThirdBowl(bowl2);
                frame = new LastFrame(bowl1, bowl2, bowl3, frameIndex);
            }

            return(frame);
        }