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.
👍
Hi @Deantwo, in Lua it's in general a good practice to return a table (aka dictionary or map), so
local solution = {}
creates a new one so that we can store our functions inside it, andreturn solution
makes so that anyone doingrequire 'solution'
receives that table (with thehigh_and_low
function inside).Ah, you meant that. I didn't see named tests in Python nor JS, so I thought they were not on this kata in general. If you prefer it, you can approve this fork: https://www.codewars.com/kumite/62ebcdba8f8ab4003d2a4d4e?sel=62ebdd4f4b883000572931e8
I don't understand why, both do the same.
The logs give clearly the actual value returned, the expected value as well as the input in case of failed test. The default setup throws a Non implemented error (like it is done frequently in other languages like Rust or C#), just replace the empty set up with
return "";
for example, and you will see. If your point is that you would like the input to be displayed clearly for each test, no matter if the test fails or not, indeed it is not really feasible with this framework, it is not designed for that.Fixed a crash in the testing suite, albeit a very rare one on this kata. Scalatest will crash if it encounters two tests with the same title, so I've just added the test case number to the title to prevent that ever happening.
Most kata's I've seen use the name
Sol
for the object.The quotation marks is an oversight, I'll fix it.
Thanks.
Ok. I would suggest to remove all the codeblocks specific to one particular language, this doesn't bring any pertinent information (the name of the function is already in the initial code, no mistake is possible) and makes the maintenance very difficult by creating undefinitely (sometimes absurd) merge conflicts, like here. The example provided at the top is enough, the rest is redundant and doesn't bring much value. It has been done on many katas already, it's even on the authoring guideline of CodeWars documentation: https://docs.codewars.com/authoring/guidelines/description/#general
Like this? If it's ok, approve the fork and reject this one.
I fixed the current fork. Nevermind the link. Is is ok?
I changed the basic tests, but on the random ones I don't know how it can be done cleanly. See this fork: https://www.codewars.com/kumite/61924812298775000ed3bbff/edit
Sorry I forgot that, it's just I used the tests from the former version and your changes didn't appear. I try to do it and let you know soon.
My pleasure. Thank you for taking care of that part I neglected!
See for example in NASM, the example given in the description is written in C, not in NASM, it would be a mess...
With at least two lines of supplementary instructions. I think it's a bit the same here, you should not worry about respecting scrupulously the syntactical constraints.
First of all I'm just a beginner in COBOL I've learnt all I know since... the last two days :)
Personally I would put simply something like this:
or
So the part result = ... is inserted like a commentary, like in other languages. Beware that to insert a commentary you need to put the asterix exactly on the 7th character of the line. Though it is. strictly speaking, syntactically incorrect (as far as I know you cannot call a function this way), I think it's light and not ambiguous. I don't know how it has been done in other katas, if it has ever been done.
Loading more items...