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 solution of mine isn't consistent.
var code = [5,5,5];
function tryCode(indications) {
// TODO : indications are null or a 3-digits array.
if(indications){
indications.map(function(e,i){
code[i] += indications[i];
})
}
return code;
}
This is my refactored solution! Codewars is having problems with accepting another solution.
Your description needs work
0 = correct digit
-1 = higher digit
1 = lower digit
I have to interpret your example and not your instructions.
FIX IT PLZ
Preloaded as Fruits[];
return Fruits;
It isn't defined.
Fix this please.
Whats the point of lambdas in Ruby?
Haha nice!
Here's why I think you got it wrong
I don't believe the code kata inputs the questions array into any function.
I don't think you're wording the backstage conditions correctly or they are not very clear:
Here's what I understood from it at the beginning:
Backstage should increase in quality += 1 every sell in
If backstage sell ins are <=10
they should increase by 2 instead
If backstage sell in are <=5
they should increase by 3 instead
end
Here you have a backstage with 7sell in, 9 quality. Let's count the sell ins.
7=>6 increase by 2 quality = 11
6=>5 increase by 2 quality = 13
5=>4 increase by 3 quality = 16
4=>3 increase by 3 quality = 19!!!!!!!!!!
Thats 4 days. Where the final sell in/day is ending at 3. Going from 7>6>5>4. 2 of those days should be +2 each. The other 2 should be +3 each.
I know the answer it's testing for is +quality: 2,3,3,3
But the wording is very vague and confusing.
Starting items in the store are {Conjured Goblin Axe +5, 7, 13}, {Canned Laughters, 9, 12}, {Priss and the Replicants Backstage Passes, 7, 9}, {Conjured Goblin Axe +5, 9, 38}, {Zero Zone Kevlar Vest +1, 8, 22} and 4 days passed
OUTPUT:
Checking item 3: Priss and the Replicants Backstage Passes
Test Passed: Value == 3
Not the expected quality value - Expected: 20, instead got: 19
What if there's a 12 names in the array? Or 20 names? Your code would break. Refactor it so that it doesn't rely on hardcoding indexes to work.
Why would you write a for loop if you're just going to hardcode the indexes???
This isn't what the exercise was meant for IMO!
not even test cases
I"m getting a
"<NoMethodError: undefined method `*' for nil:NilClass> "
for one of the tests... everything else passes.
There are NO FUNCTIONS in ruby I am told. It's a method.
I did not see the stipulation. Sorry, but the code should work. Just check for syntax errors!