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've deep-frozen the configuration objects in a new version of this kata. Not sure if it's smart to mutate function arguments in the first place though :P
They too are now deep-frozen.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The way I see it, there are two ways around this problem:
Instead of checking for bit-to-bit accuracy, calculate the difference between test and actual images, and check if it's below a certain threshold. Problem with this is that it might allow some actual bugs go through, or it might not let a valid, but complex image go through
Instead of using pre-rendered data for the test-cases, generate the test data within the tests, so that differences in canvas rendering will also be present in the test images.
Check out this page: https://browserleaks.com/canvas
As you can see, it will give you a uniqueness percentage, of how your browser draws a set of drawing instructions. The uniqueness is likely quite high too. What this means, is that your browser produces a different image from other browsers, so by definition, expecting pixel-perfect, bit-to-bit accuracy in this Kata is misguided.
I don't like this. My perfectly valid solution is getting rejected, because of floating point errors. My math and drawing procedures are solid, but because the test cases expect bit-to-bit accuracy (which can be impossible to achieve cross-browser/cross-OS with Canvas), my solution isn't not going through.
For example, take a look at my drawing vs. test case here: https://i.imgur.com/q0YkNSp.png
You might not even see the difference, yet there are sub-pixel inaccuracies, and I'm absolutely sure it's not my code that's causing those. It's inherent to Canvas API implementations.
All inputs for which conversion to integer would be nonsensical (as is the case with Infinity), should return zero.
If it helps; this kata can be completed with under 40 characters of code.
Y is most definitely a vowel where I come from. It is pronounced as a vowel in words such as happY, todaY, rhYthm, sYllable, manY, analYse and many others.
Since this is a JavaScript test and not a test of specialized knowledge of english phonetics, I think it should be at least mentioned in the task description, if not omitted from test cases.
8008 is the correct input for 80085e-1, according to the test case as well.