7 kyu
80's Kids #2: Help ALF Find His Spaceship
617 of 2,089NateBrady23
Loading description...
Arrays
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
JavaScript fork, added sample tests, random tests, updated to Chai and latest Node.
approved
python new test framework is required. updated in this fork
Approved
Hello,
I would be very grateful if the author of this challenge could please review the programming of this challenge
No matter what programming I write or what I ask this challenge to return - regardless of whether or not it is related to this challenge - all I get is a message saying 'should test for something'
Duplicate issue: No sample tests in JS at least.
I first encountered this problem in JavaScript but I would be very grateful if all programming languages could please be checked
C++ missing
#include <string>
in initial solution and perhaps test case section as pointed out hereNo random tests in JS at least
No sample tests in JS at least
assert.deepEqual
should be used in JS && CSJS issues have been resolved.
CS still needs to be updated.
I don't see how this is related to any of the following tags: LAMBDAS, FUNCTIONAL PROGRAMMING, FUNCTIONS, DECLARATIVE PROGRAMMING
I also think DATA STRUCTURES is a bit of a stretch.
Most of the reference implementations doesn't even use functional programming.
Please don't open issues about tags. That's ridiculous. Idk who edits the tags but it has nothing to do with an issue with the kata. Suggestions, maybe, but not issues.
Most tags are automatic (and wrong, yes). Nobody is "editing" them.
Did not appreciate the irregular/non-rectangular map that appeared in the attempt test cases - had no idea it was coming because no warning given by instructions or example.
I'm so sorry you didn't appreciate that. I hope it didn't ruin your day.
Probably only frustrated me because I'm a new coder and I take the instructions very literally. I've enjoyed all the other 80s kata you've made. Thank you.
I understand. You will probably encounter many more of these in your katas here. Always a good idea to console log the input as one of the first things you do. Good luck on your journey!
Good advice, thank you!
c++ ..... ....X ..... .....
Yes, tests are bad in C++, one needs to add 1 to the second coordinate on random tests.
Not an issue, the index is counted from bottom right of the grid to the top!!!
Am i missing something or There is an issue in reference solution in C++?
Yep, see my reply to eb110 just above.
on JS i think 1 test is broken to be specific "....... X......." this one it says that it should return [0,0] but instead the spaceship is situated at [0,1]
Can confirm
Not broken, Visualize the description carefully
@NateBrady23, C++ translation ready for review.
Approved some time agooo
@NateBrady23, C++ translation ready for review.
java/python inconsistency:
in java, one may find an irregular map with one line not having the same length than the others (I'd bet on a missing line feed), which seems pretty "invalid" to me. This does not happen in python.
JS have too has an 'irregular' map with one line not having the same length ^^ Anyway, at least JS version sorely lacks of tests cases (only four: 2 with position array solutions, 1 with lost spaceship, and 1 with undefined map)...
Salut visph ;)
My code is passing 10 tests, but I'm receiving 'undefined method include? for nil:Nilclass message'. Is that method disallowed?
how is 'X' mark on the 8 index of string equal to [0,0] ?? makes no sense
edit: ok i found that maps can come in any irregular shapes and sizes
nice kata.
Thank you
I'm wondering how this kata is related to functional programing and lambdas for Java. Most of the solutions I've seen have all been imperative procedures. I'm still new to Lambda expressions in Java, anybody have success using them with this?
contradecting testcases , one expecting a string and the other is expecting a list when the ship can't be found
Place give the language if there's multiple available when marking issues. I'll check it out.
Python
I don't see the problem you're mentioning? Are you just saying you don't like that there is a string being returned when the ship can't be found? Or is there a specific test that fails?
I'm going to assume this is just a preference, which should be a suggestion not an issue. The kata asks for a string response in a failing situation which is a clear specification.
Java translation kumited.
Approved! Thank you!
Hey alessandro! I missed this when I approved it, but when the ship is found, an array is expected.
Hi Nate! I know, but in Java is not possible to return either an array or a string. There were two ways to translate your original idea:
null
when ALF is lost...I went for the second one. I liked the "*talking*" result, and also the solution seemed more complete for me in this way. I think now it's difficult to change the code if someone has already solved the Java version.
Since I'd like to translate all your wonderful katas, next time I'll face a similar choice (there will be!) I'll be ask your opinion first, or at least I'll point it out in the discussion.
Of course! I'm so used to dynamically typed languages, I forget about that with Java. I trust your discression on the Java translations. Thanks!
The ruby example tests require the response as a string, but the submission tests require the response as an array.
Fixed. Thanks for catching that! :)
I've just faced the same problem. I had to comment out the
is_a?(String)
test in the test case examples. That test could be removed.Removed! Thanks :)
Python translation provided :)
Had to fork because of description changes. You still get full credit when I do that right?
Probably I do, but don't bother and thanks for caring :)
You either need to specify that space is square or add a test case which will cause this solution to fail.
Ruby version for you to approve
If you could update this to match the new return type I will approve right away. Thanks for your advice and work!
Ruby version updated.
Needs some random tests.
Why are you forcing the return value to be a string rather than an array?
I'm not sure why I did that at first, but I've updated the details and JS tests for an array instead.
The example map and answer is valid for both the top left and bottom left being '[0, 0]'
I suggest you change the example map to one that only has one valid interpretation.
I think was fixed to what you had wanted? Let me know if not. Thanks Insti!
It wasn't, but I've fixed it by adding another empty row to the example given in the description.