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.
This comment is hidden because it contains spoiler information about the solution
Ah. A fatal flaw... you may have to write a new kata to fix it, unfortunately. Unless you can get hold of someone on the CW team. They're about. Somewhere... They should be able to discuss the situation and unlock it if necessary.
I was just trying to add some more tests but have an information that "Test cases can no longer be edited for this kata". Sorry
rlubinsky, your code simply does not work with number==1. And 1 is a proper power of 4 (4**0), that's all :)
Also, I would completely rethink your algo for checking it, but it could work that way too, provided you consider this kind of cases.
Oh and as the creator could pass by: I kumited the Python version; any idea how it works to get it approved? I mean, if it is up to you, it becomes some kind of beta or what.
Could you add a reply with your code, and marked as "spoiler"? It will make it easier to help.
Same problem here but with the JS version
powerOf4
powerOf4 should be defined
Test Passed
should return true for powers of 4
Test Passed
Test Passed
Test Passed
Test Passed
should return false for non powers of 4
Test Passed
Test Passed
Value is not what was expected
Value is not what was expected
Test Passed
Test Passed
Test Passed
should return false for non positive integer inputs
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
You could add numeric strings, such as "4", which shouldn't pass, but would with some existing solutions.
I'm not much proficient with Ruby, but my check to see if it is numeric just works fine.
Btw, I presume you solved it by now, but what was your original code?
I presume you are using Ruby; care to provide us with your code? And consider the extra tests when submitting also include not integer arguments.
I'm not sure what I'm missing as my tests pass but when I submit it fails and it's not telling me why...
I kumited a Python translation; let me know if it is ok with tests and stuff :)
exactly ! expect(powerOf4(20), false) should be included in tests
Technically speaking, 1 is a proper power of 4 (4**0 in Python notation), so I would add a specific requirement for it to have an exponente greater than 0 in the description of the kata for js.
Edit: and the Ruby version accepts the 1 as a true multiple of 4, so it makes little to no sense to consider it a false in js.
This comment is hidden because it contains spoiler information about the solution