Skip to content

Add more detailed description of method setRange(min, max) in README.md #31

@sg4014

Description

@sg4014

Add changes to README.md

Change this:

setRange(min, max)
this method accepts min and max value of range of number to guess

To this:

setRange(min, max)
this method accepts min (not included) and max (included) value of range of number to guess,
in mathematics that would be (min, max]

Why do so

The proposed changes leave less room for ambiguity.
The solution that passes all tests does not find the min value of method setRange,
no matter how many times method lower is called.
It implies that min is not included in the searching range.
Possibly because of that a common binary search algorithm that can actually find min won't pass most of the tests.

The solution that passed 100% of the tests won't find the min value 0 of setRange(0, 4)

const game = new GuessingGame;

game.setRange(0, 4);

console.log(game.guess()); // 2
game.lower();

console.log(game.guess()); // 1
game.lower();

console.log(game.guess()); // 1
game.lower();
console.log(game.guess()); // 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions