Skip to content

savlevich/guessing-game

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Guessing game


⚠️ DO NOT SUBMIT PRS WITH SOLUTIONS TO THIS REPO ⚠️

Description

Your task is to implement GuessingGame class

Methods:

setRange(min, max)

this method accepts min and max value of range of number to guess

guess()

this method returns solution candidate (you make an assumption based on range and previous assumptions)

lower()

this method is called if prev call of guess() returned number which is lower than answer

greater()

this method is called if prev call of guess() returned number which is greater than answer

Your implementation should use binary search algorithm under the hood to pass all tests

Prerequisites

  • Install nodejs (>= v6.9.4)
  • open bash in this folder
  • npm install

Run tests

npm test

Run in browser

npm start

open http://localhost:8080


© R1ZZU

About

Guessing game tests

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.7%
  • HTML 0.3%