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.
Python:
This comment is hidden because it contains spoiler information about the solution
Thank you!
done
Would you add Python 3?
No random tests.
Coffeescript translation kumited. Have fun!
(JS)
Oh.
My.
Goodness.
I implement a linked list and pass all the Example Tests. I leave
.search()
empty for now because it's completely unspecified what it should do and I am passing the tests anyway.I then run the Submit Tests to see what more I should do (because it sure isn't in the Description).
I fail all of them, with
TypeError
s which leave me mystified and error messages which leave me even more mystified because they are unapplicable. All of them? No, one test fails with an English error: "..remove either the head and [the] tail .."Please provide full specifications in the Description.
Please provide Example Tests that actually indicate whether or not a solution is going in the right direction.
Please just use Submit Tests to extensively check all edge and corner cases, perhaps check for performance, and, using random tests, to prevent cheating.
I am passing all the Example Tests and I am failing all of the Submit Test categories. And I have not a clue what I am doing wrong.
These are not the makings of a good kata.
Hi,
I am not seeing all the test suites and specs within this Kata's Test Cases. I know this because when I click Submit a few test specs fail, at which point the results identify more test specs than in the Test Cases text area.
@fvc: Sorry I didn't reply until now; must've slipped through the cracks in my email or something. Explaining the metaphor is nice for newbies, but beyond that I'd just stick to a "spec" of what needs to be coded. Code examples are great for this. This would give the coder all the information they need to complete the kata, without giving any ideas on how is could be achieved, thus keeping the fun of solving the problem intact.
I've written an example of a spec-like explanation below. You can use it, edit it, write your own, whatever you want. And I'd suggest adding edge cases to the descriptions, too; what happens if nothing was passed in to
.enqueue()
, or there are no items in the queue when calling.dequeue()
?new Queue();
Creates a new Queue instance.
instance.enqueue(item);
Adds the given
item
to the queue. You can do this however you want, as long as you can implement the other methods.instance.size();
Returns the number of items that have are in the queue so far.
instance.dequeue();
Removes one item from the "front" of the queue (the item added earliest), and returns it.
I was just coming in to say thanks for such a nice setup and explanation. I had been avoiding it for awhile because of the word queue, and was pleasantly surprised with a straightforward explanation and challenge.
It was definitely pretty easy, but most of the time I see katas that introduce a new topic I bang my head against them and eventually have to go look at the answers to see what I need to go look up.
Minor issue, according to PEP8 (Python):
Function names should be lowercase, with words separated by underscores as necessary to improve readability.
mixedCase is allowed only in contexts where that's already the prevailing style (e.g. threading.py), to retain backwards compatibility.
Thanks for this kata!
I agree with everyone on this page. Requirements on when to return null and when to return undefined seem arbitrary. Suggest you either accept both values, or always require either null or undefined, or spell out exactly when you want null and when you want undefined in the kata description.
Needs word. I think this Kata has potential, but the previous comments should probably be addressed. I would be great to include more test cases as well.
Loading more items...