Skip to content

Instantly share code, notes, and snippets.

@TheSecretSquad
Created May 2, 2014 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheSecretSquad/85b7357b01269eec68dd to your computer and use it in GitHub Desktop.
Save TheSecretSquad/85b7357b01269eec68dd to your computer and use it in GitHub Desktop.
Bowling Score Calculator Kata from Daedtech.com Alternative Design Question - http://www.daedtech.com/tdd-for-breaking-problems-apart-3-finishing-up
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace ScratchPadTest
{
public class Frames
{
private readonly Frame[] _frames = new Frame[10];
private int _currentFrame;
public void Push(Frame frame)
{
_frames[_currentFrame++] = frame;
}
public Frame Last { get { return BackFromLast(1); } }
public Frame BackFromLast(int number)
{
return _frames[_currentFrame - number];
}
public int Count { get { return _currentFrame; } }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment