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.
I could win a gold medal in the olympic 100m dash, but the other guys keep cheating by running faster than me. Life sure is cruel.
I think it is worth noting that this could give an unexpected answer if two ints of max value are passed in. The problem is not very clear on the range of allowed values for a and b.
It's doing a conversion to string, providing the base number you want it to be converted to/from.
In this case, providing base 2 means that it will be converted to binary. Similarly, base 8, 10 and 16 can also be used.
Base10 being standard numbering. I think.
Using what's available to you hardly counts as cheating :P
But yeah- I kinda wanted to write a proper method for converting to binary myself, ended up doing the above.
A Lazy developer is an effective developer :D
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
You get used to them when you start using them.
That's just cheating, not a "clever" solution.
Lamba method bodies are not that readable in my opinion.
How...
At the end I just made the Random object global and it worked!
I did that kata yesterday, and spent a fair amount of time reading up on best ways to randomize stuff. From what I read, math.Random is actually pretty bad at randomizing stuff.
That being said, I did see kata solutions using random which were accepted. How many times did you try submitting your answer? Maybe try again? Otherwise, there's probably something else wrong. If you console log your array a bunch of times in a row, you will probably see some patterns. 1 number out of 15 being in the same spot in a column 30% of the time is wrong; any number being in a column at all only has a 33% chance (and 25%-ish for the middle column).
I'm doing the Bingo Card kata. I did use Random class. However, it says "The same number appeared on more than 30 of the 100 cards on the same spot, are the cards random?
Expected: False
But was: True"
Having each square 15 posibilities and 5 places to be, it doesn't seem weird to get the case of sharing the same spot when you test with 100 different ones.
If I did random the numbers, how can I fix this problem? Thanks!