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.
Fixed.
Done, switched to markdown. Thanks for the feedback.
Description should use markdown instead of HTML. For section titles you can use
## h2 headers
or### h3 headers
and lower (I do not like h2 because I think they are too big, but you can pick whichever you prefer),<br>
is a double trailing space,<p>
is supported directly by markdown as newline-separated paragraphs.Got it!
A couple more:
@Order
does not work without the method orderer or the class orderer annotation. See the collection of examples I linked in the initial post, or JUnit documentation on@Order
.Group
class has the problem of overridingequals
, but nothashCode
, which is wrong. In general, the whole class with getters, setters, overrides, constructors, could be brought down to just a single line ofpublic record Group(int size, int timeTaken) {}
. Compiler automatically generates constructors, accessors, stringifiers, and equality for records.string += elem
intablesToString
andqueueToString
is a really bad pattern. It should be aStringBuilder
or a joiner, or both should be ditched in favor of/implemented on top ofArrays.toString
.rand
should be private. You might also want to considerThreadLocalRandom
instead (but I don;t remember if it is that important in context of CW kata).This should be fixed now. Thank you!
This should be fixed now!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Thanks for checking and for your feedback! Hope this kata is alright then :)
I've fixed the things to do with tests in your original comment. I also don't like how its a int[2] element for queue, but was worried that changing it to include a preloaded class might make it harder to be translated to a different language in the future. I'm fairly new to OOP so I actually didn't know about records but it looks super handy for this use case so I will try it out.
Some kata on similar topic, but I think presenting not exactly similar problem:
I do not remember any problem which would require processing a queue with the additional constraint of minimal required capacity.
Do you know which kata it is similar to? I tried to find any that already exisited before making this but didn't see anything super close.
This might also be a duplicate, or at least very similar to an existing kata.
int[2]
as elements ofqueue
, I would make it into a preloadedrecord Group(int count, int time)
.You can check out the authoring examples collection for some ideas.
Very minor feedback- there is a small typo in the description:
they do not know hot to calculate the time properly -> they do not know how to calculate the time properly
Loading more items...