Bulls and Cows game solver utility. Guesses a 4 digit number randomly for now.
To install and this library make sure you have NodeJS and run:
npm install bulls and cows
- Then you can require the library:
var GameSolver = require('bulls-and-cows').GameSolver;
- GameSolver is a class and each instance holds 1 game history, so you need to create an instance of the class
var gs = new GameSolver();
- To get a guess from the library call the method
makeRandomGuess()
- You can update the number of Bulls and Cows, but the library actually does not use these values
- NodeJS
To get a development copy clone this repo and run npm install / yarn
inside the folder
The test are written using Jest.
To test the code run npm test
I would love to discuss how to add new solution methods to this package.
This project is licensed under the MIT License - see the LICENSE.md file for details