当前位置: 首页>>代码示例>>C#>>正文


C# Game.Score方法代码示例

本文整理汇总了C#中Game.Score方法的典型用法代码示例。如果您正苦于以下问题:C# Game.Score方法的具体用法?C# Game.Score怎么用?C# Game.Score使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Game的用法示例。


在下文中一共展示了Game.Score方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ScoreAllOnesGame

        public void ScoreAllOnesGame()
        {
            var game = new Game();
            RollPinsSeveralTimes(game, 20, 1);

            Assert.AreEqual(20, game.Score());
        }
开发者ID:RyanBetker,项目名称:Kata.Bowling,代码行数:7,代码来源:GameTest.cs

示例2: ScoreGutterGame

        public void ScoreGutterGame()
        {
            var game = new Game();
            RollPinsSeveralTimes(game, 20, 0);

            Assert.AreEqual(0, game.Score());
        }
开发者ID:RyanBetker,项目名称:Kata.Bowling,代码行数:7,代码来源:GameTest.cs

示例3: Strike

 public void Strike()
 {
     var game = new Game();
     game.Roll(10);
     game.Roll(5);
     game.Roll(1);
     Assert.Equal(22, game.Score());
 }
开发者ID:cschrammel,项目名称:BowlingKata,代码行数:8,代码来源:GameTests.cs

示例4: Game

        public void 二回投げて合計値を計算できる()
        {
            var g = new Game();
            g.Roll(3);
            g.Roll(2);

            Assert.That(g.Score(), Is.EqualTo(5));
        }
开发者ID:Khanchai,项目名称:BowlingGame,代码行数:8,代码来源:GameTest.cs

示例5: Spare

 public void Spare()
 {
     var game = new Game();
     game.Roll(5);
     game.Roll(5);
     game.Roll(1);
     Assert.Equal(12, game.Score());
 }
开发者ID:cschrammel,项目名称:BowlingKata,代码行数:8,代码来源:GameTests.cs

示例6: ScorePerfectGame

        public void ScorePerfectGame()
        {
            var game = new Game();

            RollPinsSeveralTimes(game, 11, 10);

            Assert.AreEqual(300, game.Score());
        }
开发者ID:RyanBetker,项目名称:Kata.Bowling,代码行数:8,代码来源:GameTest.cs

示例7: Score

 public string Score()
 {
     var game = new Game();
     foreach (int roll in _rolls.Select(x => Convert.ToInt32(x)))
     {
         game.Roll(roll);
     }
     return game.Score().ToString(CultureInfo.CurrentCulture);
 }
开发者ID:davidadsit,项目名称:bddtddfitnesse,代码行数:9,代码来源:FinalScore.cs

示例8: Score7Game

        public void Score7Game()
        {
            var game = new Game();
            game.Roll(2);
            game.Roll(5);
            RollPinsSeveralTimes(game, 18, 0);

            Assert.AreEqual(7, game.Score());
        }
开发者ID:RyanBetker,项目名称:Kata.Bowling,代码行数:9,代码来源:GameTest.cs

示例9: latterStrike

 public void latterStrike()
 {
     var game = new Game();
     game.Roll(3);
     game.Roll(6);
     game.Roll(10);
     game.Roll(5);
     game.Roll(1);
     Assert.Equal(31, game.Score());
 }
开发者ID:cschrammel,项目名称:BowlingKata,代码行数:10,代码来源:GameTests.cs

示例10: TestAllOnes

        public void TestAllOnes()
        {
            Game game = new Game();

            for (int i = 0; i < 20; i++)
            {
                game.Roll(1);
            }

            Assert.AreEqual(20, game.Score());
        }
开发者ID:aespinosa,项目名称:BowlingKata,代码行数:11,代码来源:GameTest.cs

示例11: TestPerfectGame

        public void TestPerfectGame()
        {
            Game game = new Game();

            for (int i = 0; i < 12; i++)
            {
                game.Roll(10);
            }

            Assert.AreEqual(300, game.Score());
        }
开发者ID:aespinosa,项目名称:BowlingKata,代码行数:11,代码来源:GameTest.cs

示例12: ScoreOneSpareGame

        public void ScoreOneSpareGame()
        {
            var game = new Game();
            game.Roll(4);
            game.Roll(6);
            game.Roll(2);

            RollPinsSeveralTimes(game, 17, 0);

            Assert.AreEqual(14, game.Score());
        }
开发者ID:RyanBetker,项目名称:Kata.Bowling,代码行数:11,代码来源:GameTest.cs

示例13: TestGutterGame

        public void TestGutterGame()
        {
            // Arrange
            Game game = new Game();

            // Act
            for (int i = 0; i < 20; i++)
            {
                game.Roll(0);
            }

            // Assert
            Assert.AreEqual(0, game.Score());
        }
开发者ID:aespinosa,项目名称:BowlingKata,代码行数:14,代码来源:GameTest.cs

示例14: TestOneStrike

        public void TestOneStrike()
        {
            Game game = new Game();

            game.Roll(10); // strike
            game.Roll(3);
            game.Roll(4);
            for (int i = 0; i < 16; i++)
            {
                game.Roll(0);
            }

            Assert.AreEqual(24, game.Score());
        }
开发者ID:aespinosa,项目名称:BowlingKata,代码行数:14,代码来源:GameTest.cs

示例15: Main

 private static void Main(string[] args)
 {
     var positionFinder = new PositionFinder(_boardSize);
     var surroundingTileFinder = new SurroundingTileFinder(_boardSize, positionFinder);
     _gameEngine = new Game(new Board(_boardSize, positionFinder, surroundingTileFinder));
     _inputMapper = new KeyboardInputMapper();
     while (_gameEngine.Board.AvailableMoves().Count > 0)
     {
         DrawBoard(_gameEngine.Board);
         ProcessInput();
     }
     DrawBoard(_gameEngine.Board);
     System.Console.WriteLine("\n\nGame Over.  Score: " + _gameEngine.Score() + ".  Press Enter to continue.");
     System.Console.ReadLine();
 }
开发者ID:cschrammel,项目名称:Voracity.net,代码行数:15,代码来源:Program.cs


注:本文中的Game.Score方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。