This program converts a number to a string, the contents of which depends on the number’s prime factors.
If the number contains 3
as a prime factor, output "Pling"
.
If the number contains 5
as a prime factor, output "Plang"
.
If the number contains 7
as a prime factor, output "Plong"
.
If the number does not contain 3
, 5
, or 7
as a prime factor, just pass the number’s digits straight through.
The program uses TDD method using Mocha and Chai
How to run the program locally:
- Run
npm install
to install all needed dependencies - Run
npm test
to start Mocha which immediately runs babel to transpil and also test