Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

source "https://rubygems.org"

# gem "rails"

gem "rspec", "~> 3.12"
26 changes: 26 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.5.0)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)

PLATFORMS
x64-mingw-ucrt

DEPENDENCIES
rspec (~> 3.12)

BUNDLED WITH
2.4.12
26 changes: 26 additions & 0 deletions lib/score.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
class Score
# Read only attribute shots is the number of pins knocked down
attr_reader :shots
PIN_COUNT = 10

def initialize
@count = []
end

def score_count(shots)
@count.sum(shots)
end

def spare(shots)
# The score is ten plus the first roll of the next frame, 10 + FX + 1.R1
PIN_COUNT + shots
end

# def strike
# PIN_COUNT + shots(one and two)
# end

# def tenth_frame
# end

end
Loading