Skip to content

CodingBat-Logic1-withoutDoubles #260

@divinedragon

Description

@divinedragon

Write code and JUnit test cases for CodingBat-Logic1-withoutDoubles

Url - http://codingbat.com/prob/p115233

Problem Statement:

Return the sum of two 6-sided dice rolls, each in the range 1..6. However, if noDoubles is true, if the two dice show the same value, increment one die to the next value, wrapping around to 1 if its value was 6.

withoutDoubles(2, 3, true) → 5
withoutDoubles(3, 3, true) → 7
withoutDoubles(3, 3, false) → 6

Expected method declaration

public int withoutDoubles(int die1, int die2, boolean noDoubles) {
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions