Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Yes. :)
It's called a "ternary operator" if you want to look up more information about it.
A random number from 1 to 1000 is generated when an Guesser object is created.
The Guesser has a method "guess(number)" that compares the parameter "number" with the randomly generated number and returns a string based on the result of the comparison ("Too high!", "Too low!", or "Correct!").
The "guess(number") method can only be called 10 times, it will raise an error if it is called more than 10 times.
Your task is to implement the method "get_number()" that will try to determine what the randomly generated number is by calling the "guess(number)" method up to 10 times (and using the returned string to make better guesses). When the correct number is determined, the method "get_number()" should return it.
It took me some time to understand this kata. It is a bit poorly worded. Hopefully this will help you. :)
Maybe it was Christmas Day when this solution was submitted ?
Isn't 1 a power of 2 ?
2 ** 0 = 1 ?
Isn't 1 a power of 2 ?
2**0 = 1 ?