Skip to content

bowling: add to track#675

Merged
Smarticles101 merged 1 commit into
exercism:masterfrom
dawcars:bowling-exercise
Jul 5, 2017
Merged

bowling: add to track#675
Smarticles101 merged 1 commit into
exercism:masterfrom
dawcars:bowling-exercise

Conversation

@dawcars
Copy link
Copy Markdown

@dawcars dawcars commented Jul 2, 2017

I have started work on bowling exercise. Work in progress


Reviewer Resources:

Track Policies

@FridaTveit FridaTveit changed the title Bowling exercise bowling: dibs on implementing exercise Jul 4, 2017
@FridaTveit
Copy link
Copy Markdown
Contributor

FridaTveit commented Jul 4, 2017

Thanks for tackling this @dawcars! :D I changed the name to "exercise-slug: dibs on implementing exercise". Once you're ready for a review feel free to change it to "exercise-slug: add to track". This is just to make it obvious to other contributors that you're working on an exercise, and obvious to reviewers once you're ready for a review :)

@dawcars
Copy link
Copy Markdown
Author

dawcars commented Jul 4, 2017

Thanks @FridaTveit. That's really helpful. I will change the name when it is ready for review. Thanks for your help. :)

@FridaTveit
Copy link
Copy Markdown
Contributor

No problem! :)

@dawcars dawcars force-pushed the bowling-exercise branch 3 times, most recently from 7181d68 to 3e7f12d Compare July 4, 2017 21:42
@dawcars dawcars changed the title bowling: dibs on implementing exercise bowling: add to track Jul 4, 2017
@dawcars
Copy link
Copy Markdown
Author

dawcars commented Jul 4, 2017

Please can you check this is OK to add to the track. It should now be ready. Many thanks

Copy link
Copy Markdown
Member

@Smarticles101 Smarticles101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's my review. These are mostly little comments on formatting that don't matter too much. The only thing that really has to be addressed is the comment I left on the starter implementation file.

@@ -0,0 +1,11 @@
public class BowlingGame {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the spot you have chosen to put this is >21, you can remove this file and replace it with a .keep file. (See the POLICIES.md file)

private int frameScore(int frameIndex) {
return rolls.get(frameIndex) + rolls.get(frameIndex + 1);
}
} No newline at end of file
Copy link
Copy Markdown
Member

@Smarticles101 Smarticles101 Jul 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed your formatting of this file is a little inconsistent, specifically on where you put your curly braces. Some are on the same line, but some are on the next. If you could just fix up the formatting that would be great. (In IntelliJ just press Ctrl+Shift+Alt+L to reformat the code)

game = new BowlingGame();
}

private void PlayGame(int[] rolls)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typically only constructors start with a capital letter. Instead of PlayGame it should be playGame

@Test
public void shouldBeAbleToScoreAGameWithNoStrikesOrSpares() {
int[] rolls = { 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6 };
PlayGame(rolls);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A newline would be nice to have in between these two lines in all the test cases

public void aSpareFollowedByZerosIsWorthTenPoints() {
int[] rolls = { 6, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
PlayGame(rolls);
assertEquals(10, game.score());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might improve readability a little bit if the expected score was a variable instead

@dawcars
Copy link
Copy Markdown
Author

dawcars commented Jul 5, 2017

Thanks for your comments @Smarticles101. They are very helpful. I will make corrections based on your comments. If you find anything else that needs alteration, please let me know.

@dawcars dawcars changed the title bowling: add to track bowling: dibs on implementing exercise Jul 5, 2017
@stkent stkent changed the title bowling: dibs on implementing exercise bowling: add to track Jul 5, 2017
@stkent
Copy link
Copy Markdown
Contributor

stkent commented Jul 5, 2017

Now that this has entered the review phase it's fine to leave it titled as "add to track" :)

@dawcars dawcars force-pushed the bowling-exercise branch from 97572be to b9e6499 Compare July 5, 2017 15:36
@dawcars
Copy link
Copy Markdown
Author

dawcars commented Jul 5, 2017

I have refactored changes as suggested by @Smarticles101 and uploaded to branch. All gradle tests are passing and I have rebased with the upstream. However I see that one of the checks is failing. Does anyone know why this might be?

@Smarticles101
Copy link
Copy Markdown
Member

@dawcars I'm trying to look into why it's failing

@Smarticles101
Copy link
Copy Markdown
Member

So far, I haven't been able to find out why it's failing. 😕

@FridaTveit
Copy link
Copy Markdown
Contributor

I've restarted it to see if that helps :) Sometimes the build fails for no apparent reason... But restarting it often helps :)

@stkent
Copy link
Copy Markdown
Contributor

stkent commented Jul 5, 2017

[If this was branched off master before #674 was merged, that could be the cause.]

@Smarticles101 Smarticles101 merged commit 4e721cd into exercism:master Jul 5, 2017
@Smarticles101
Copy link
Copy Markdown
Member

Thanks @dawcars :)

@dawcars
Copy link
Copy Markdown
Author

dawcars commented Jul 5, 2017

Thanks for your help with this @Smarticles101, @stkent and @FridaTveit. It's very much appreciated. :)

@dawcars dawcars deleted the bowling-exercise branch July 6, 2017 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants