本文整理汇总了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());
}
示例2: ScoreGutterGame
public void ScoreGutterGame()
{
var game = new Game();
RollPinsSeveralTimes(game, 20, 0);
Assert.AreEqual(0, game.Score());
}
示例3: Strike
public void Strike()
{
var game = new Game();
game.Roll(10);
game.Roll(5);
game.Roll(1);
Assert.Equal(22, game.Score());
}
示例4: Game
public void 二回投げて合計値を計算できる()
{
var g = new Game();
g.Roll(3);
g.Roll(2);
Assert.That(g.Score(), Is.EqualTo(5));
}
示例5: Spare
public void Spare()
{
var game = new Game();
game.Roll(5);
game.Roll(5);
game.Roll(1);
Assert.Equal(12, game.Score());
}
示例6: ScorePerfectGame
public void ScorePerfectGame()
{
var game = new Game();
RollPinsSeveralTimes(game, 11, 10);
Assert.AreEqual(300, game.Score());
}
示例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);
}
示例8: Score7Game
public void Score7Game()
{
var game = new Game();
game.Roll(2);
game.Roll(5);
RollPinsSeveralTimes(game, 18, 0);
Assert.AreEqual(7, game.Score());
}
示例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());
}
示例10: TestAllOnes
public void TestAllOnes()
{
Game game = new Game();
for (int i = 0; i < 20; i++)
{
game.Roll(1);
}
Assert.AreEqual(20, game.Score());
}
示例11: TestPerfectGame
public void TestPerfectGame()
{
Game game = new Game();
for (int i = 0; i < 12; i++)
{
game.Roll(10);
}
Assert.AreEqual(300, game.Score());
}
示例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());
}
示例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());
}
示例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());
}
示例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();
}