Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b12c1e2
Project setup
siqbal181 Apr 21, 2023
a0e5055
Adding some methods to practice
siqbal181 Apr 21, 2023
a97fa5b
Adding spec helper
siqbal181 Apr 21, 2023
b43b431
Test for adding score and returning
siqbal181 Apr 21, 2023
ccdb3fd
Added frame < 10 logic for the score addition
siqbal181 Apr 22, 2023
329acec
Tested final score comment
siqbal181 Apr 22, 2023
ed99c2e
third roll addition
siqbal181 Apr 22, 2023
06012c0
Trying to fix roll_three to add to total score with test
siqbal181 Apr 22, 2023
2909648
Failing Tests but committing
siqbal181 Apr 22, 2023
ed663fc
Add roll_three logic to total_score with frame == 10
siqbal181 Apr 22, 2023
db3864e
tests for roll_three if spare or strike
siqbal181 Apr 22, 2023
52958c5
Gutter Ball message
siqbal181 Apr 22, 2023
8c4ed7c
File name changed
siqbal181 Apr 22, 2023
6ee2ad5
Test
siqbal181 Apr 22, 2023
c129d60
Added second file for testing alternative
siqbal181 Apr 22, 2023
bb431d9
Frame test for pin adding
siqbal181 Apr 23, 2023
8f4d099
Spare and strike tests on Frame class
siqbal181 Apr 23, 2023
6361f23
RSpec integration for adding Frame points
siqbal181 Apr 23, 2023
11f973f
File name changes
siqbal181 Apr 23, 2023
56f1cfe
Changed roll pins in one method and adding a new strike integration test
siqbal181 Apr 23, 2023
cf77fe0
Frame points working out
siqbal181 Apr 23, 2023
22573f7
RSpec test cleanup
siqbal181 Apr 23, 2023
6227d09
dont know
siqbal181 Apr 23, 2023
30f7d96
Testing push
siqbal181 Apr 24, 2023
64895de
not sure
siqbal181 Apr 24, 2023
1cdf20e
Tests
siqbal181 Apr 24, 2023
a0a2c2e
Adding test for strike
siqbal181 Apr 24, 2023
565c7f9
Further test for strike/spare clarity
siqbal181 Apr 25, 2023
63437b5
Trying to calculate final score
siqbal181 Apr 25, 2023
c32272d
tenth frame logic
siqbal181 Apr 25, 2023
bd79393
Added tests for total score
siqbal181 Apr 27, 2023
41e4193
Added tests
siqbal181 Apr 28, 2023
00f3b51
Bonus Third Roll
siqbal181 Apr 28, 2023
e1e308f
Working all tests
siqbal181 Apr 28, 2023
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
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

source "https://rubygems.org"

# gem "rails"

gem "rspec", "~> 3.12"
gem 'simplecov', require: false
34 changes: 34 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.5.0)
docile (1.4.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)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)

PLATFORMS
arm64-darwin-21

DEPENDENCIES
rspec (~> 3.12)
simplecov

BUNDLED WITH
2.4.12
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
Bowling Challenge in Ruby
=================
# Bowling Challenge in Ruby

* Feel free to use google, your notes, books, etc. but work on your own
* If you refer to the solution of another coach or student, please put a link to that in your README
* If you have a partial solution, **still check in a partial solution**
* You must submit a pull request to this repo with your code by 9am Monday week
- Feel free to use google, your notes, books, etc. but work on your own
- If you refer to the solution of another coach or student, please put a link to that in your README
- If you have a partial solution, **still check in a partial solution**
- You must submit a pull request to this repo with your code by 9am Monday week

## The Task

Expand All @@ -16,22 +15,24 @@ A bowling game consists of 10 frames in which the player tries to knock down the

As usual please start by

* Forking this repo
- Forking this repo

* Finally submit a pull request before Monday week at 9am with your solution or partial solution. However much or little amount of code you wrote please please please submit a pull request before Monday week at 9am.
- Finally submit a pull request before Monday week at 9am with your solution or partial solution. However much or little amount of code you wrote please please please submit a pull request before Monday week at 9am.

___STRONG HINT, IGNORE AT YOUR PERIL:___ Bowling is a deceptively complex game. Careful thought and thorough diagramming — both before and throughout — will save you literal hours of your life.
**_STRONG HINT, IGNORE AT YOUR PERIL:_** Bowling is a deceptively complex game. Careful thought and thorough diagramming — both before and throughout — will save you literal hours of your life.

## Focus for this challenge

The focus for this challenge is to write high-quality code.

In order to do this, you may pay particular attention to the following:
* Using diagramming to plan your approach to the challenge
* TDD your code
* Focus on testing behaviour rather than state
* Commit often, with good commit messages
* Single Responsibility Principle and encapsulation
* Clear and readable code

- Using diagramming to plan your approach to the challenge
- TDD your code
- Focus on testing behaviour rather than state
- Commit often, with good commit messages
- Single Responsibility Principle and encapsulation
- Clear and readable code

## Bowling — how does it work?

Expand Down
2 changes: 2 additions & 0 deletions coverage.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
No examples found.
Coverage report generated for RSpec to /Users/sidraiqbal/Documents/bowling-challenge-ruby/coverage. 0 / 0 LOC (100.0%) covered.
5 changes: 5 additions & 0 deletions coverage/.last_run.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"result": {
"line": 95.74
}
}
234 changes: 234 additions & 0 deletions coverage/.resultset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
{
"RSpec": {
"coverage": {
"/Users/sidraiqbal/Documents/bowling-challenge-ruby/spec/frame_spec.rb": {
"lines": [
1,
1,
null,
1,
1,
1,
1,
1,
null,
null,
null,
1,
1,
1,
1,
null,
null,
null,
1,
1,
1,
1,
null,
null,
null,
1,
1,
1,
1,
null,
null,
null,
1,
1,
1,
1,
null,
null,
null
]
},
"/Users/sidraiqbal/Documents/bowling-challenge-ruby/lib/frame.rb": {
"lines": [
1,
1,
35,
35,
null,
null,
1,
35,
35,
35,
null,
null,
1,
35,
null,
null,
1,
24,
null,
null,
1,
21,
null,
null
]
},
"/Users/sidraiqbal/Documents/bowling-challenge-ruby/spec/game_spec.rb": {
"lines": [
null,
null,
null,
null,
null,
null,
null,
null
]
},
"/Users/sidraiqbal/Documents/bowling-challenge-ruby/spec/integration_spec.rb": {
"lines": [
1,
1,
null,
1,
1,
1,
1,
1,
10,
10,
null,
1,
null,
null,
null,
1,
1,
1,
1,
8,
8,
null,
1,
1,
1,
1,
1,
null,
null,
null,
1,
1,
1,
1,
1,
1,
9,
9,
null,
1,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
]
},
"/Users/sidraiqbal/Documents/bowling-challenge-ruby/lib/game.rb": {
"lines": [
1,
null,
1,
1,
3,
3,
3,
null,
null,
1,
30,
null,
null,
1,
1,
null,
null,
1,
null,
1,
null,
1,
1,
0,
null,
1,
null,
null,
null,
null,
1,
2,
2,
20,
1,
null,
20,
0,
null,
null,
2,
null,
null,
1,
null,
0,
0,
null,
null
]
}
},
"timestamp": 1682696390
}
}
Empty file added coverage/.resultset.json.lock
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions coverage/assets/0.12.3/application.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions coverage/assets/0.12.3/application.js

Large diffs are not rendered by default.

Binary file added coverage/assets/0.12.3/colorbox/border.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added coverage/assets/0.12.3/colorbox/controls.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added coverage/assets/0.12.3/colorbox/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added coverage/assets/0.12.3/favicon_green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added coverage/assets/0.12.3/favicon_red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added coverage/assets/0.12.3/favicon_yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added coverage/assets/0.12.3/loading.gif
Binary file added coverage/assets/0.12.3/magnify.png
Loading