Aaaah, okay I was reading the logs off by one and typo'd my directions. I did think it seemed odd, I couldn't fathom how that was supposed to work unless it was body relative directions. Much thanks for your help!
Oh. Okay so, I'm missing more direction. I need separate axis to better calcualte my position, instead of just +1 and -1, it has to be x++, x--, y++, and y--.
Yes, but in the [ 'n', 'e', 'n', 'e', 'n', 'e', 'n', 'e', 'n', 'e' ] example, would you actually end in the same place you started? Your code says that you will...
I think you're actually failing on the test right before that one. The log for the tests appears above the result for that test. Your logic appears to have an unintentional typo that is causing your code to fail.
That test doesn't expect true, your code is returning true for it (p.s.: it seems that's not the test your code is failing), the expected answer is false. Look harder at your switch you have a typo there.
This example fails, expecting "true" but it only moves north and west so it can't possibly return to the origin point? Shouldn't this be false? Where am I going wrong?
You can always print to the terminal/console by including a print statement in whatever language you are working in - sorry I don't know Javascript, but whatever you use to print stuff on screen usually like in a Hello World! program - just include it in the main body of your function, and include the name of the argument that the kata is using.
You might find the following document useful also - I've linked the part about printing the input: Troubleshooting - codewars
Aaaah, okay I was reading the logs off by one and typo'd my directions. I did think it seemed odd, I couldn't fathom how that was supposed to work unless it was body relative directions. Much thanks for your help!
This comment is hidden because it contains spoiler information about the solution
Oh. Okay so, I'm missing more direction. I need separate axis to better calcualte my position, instead of just +1 and -1, it has to be x++, x--, y++, and y--.
Yes, but in the
[ 'n', 'e', 'n', 'e', 'n', 'e', 'n', 'e', 'n', 'e' ]
example, would you actually end in the same place you started? Your code says that you will...I think you're actually failing on the test right before that one. The log for the tests appears above the result for that test. Your logic appears to have an unintentional typo that is causing your code to fail.
That test doesn't expect true, your code is returning true for it (p.s.: it seems that's not the test your code is failing), the expected answer is false. Look harder at your switch you have a typo there.
This comment is hidden because it contains spoiler information about the solution
I'm not sure where I'm going wrong, but this is expecting true and I'm not certain how that can be?
['n', 'w', 'n', 'w', 'n', 'w', 'n', 'w', 'n', 'w']
This example fails, expecting "true" but it only moves north and west so it can't possibly return to the origin point? Shouldn't this be false? Where am I going wrong?
It's failing this test:
[ 'n', 'e', 'n', 'e', 'n', 'e', 'n', 'e', 'n', 'e' ]
and it's clear why.This comment is hidden because it contains spoiler information about the solution
Print the input yourself (read the post below for javascript): https://docs.codewars.com/training/troubleshooting#print-input
Not a kata issue.
Sure would love to see tests that failed, instead of just being told a bunch of stuff failed. Seriously in the dark about what's going wrong.
Your code not working is not a kata issue. An issue is a bug in the kata. Please refer to the documentation: https://docs.codewars.com/training/troubleshooting/
This comment is hidden because it contains spoiler information about the solution
You can always
print
to the terminal/console by including a print statement in whatever language you are working in - sorry I don't know Javascript, but whatever you use to print stuff on screen usually like in a Hello World! program - just include it in the main body of your function, and include the name of the argument that the kata is using.You might find the following document useful also - I've linked the part about printing the input:
Troubleshooting - codewars
Loading more items...