Ko-Sit / guessing-game

Guessing game tests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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


Languages

Language:JavaScript 99.7%Language:HTML 0.3%