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.
fix your indentation man
The nudge towards a style of dynamic programming (by requiring lots of function defs) makes it harder than 6kyu for me (admittedly, the kata can be solved without such techniques). I was not asked for a rating after completing, though.
Random tests aligned with changes in
attributes
typeEdited, now
attributes
is an object. I'll mark this suggestion as resolved as well as random testsBetter to not make
attrib
optional.content
can be optional ( but won't be in Haskell ). Both can be empty though.Ok, so we could transform the result in this form
Where both
attributes
andcontent
aren't required.I'll wait some feedback from you in order to make changes in Kata
Looking better. Existing solutions have been revalidated as passing, which is probably correct.
Sorry for the delay. In fact there were some bugs in the random test procedure. I fixed them, now you shouldn't see anymore the
attribute
you describe and stringcontent
as well. I tested the results by searching for/\s\s/g
,/\w\)/g
and/\w\s\)/g
and can't find this behaviour anymore.I am consistently getting some
content
s that are strings, not arrays of strings, in the random tests.I haven't beem able to figure out where that's generated, sorry.
Also, can an attribute key somehow be
" "
? I'm getting spurious spaces in my solution output as well, and I can't figure out where that comes from either.Added
attributes
in random tests. Unfortunately they are randomstring
so they can be non-valid format for an HTML validation but in terms of testing they are valid.I added a table to describe
element
, now I will complete random tests with attriutes. Later I'll change the way attributes are written but, first of all, a good cigarette!Excuse me, in fact inside the description I don't specify that
content
is anarray
, altought in the example it is shown, I'll edit this now. Function results are alwaysstring
. For your second pointcontent
already is always anarray
. I will revise description to be more clear, thank youActually, the user solution is always in the same file. So you can just
require
that.That still leaves you with namespaced functions, so it doesn't really add anything over having the user solution define an object with a number of function properties which you can use directly, without
require
ing anything.The
with
trick mentioned above is, of course, evil, but it works ( I checked. See the fork of my solution. ). Or you could define properties onGLOBAL
for properties on the user object, or you could use the namespaced name ( but that's not as pretty ).There's probably a way to include the user object in the context of the tests ( without using
with
). I haven't looked into that.You're breaking your own spec in the new tests though. Actually, you never specified
content
is an array. But passing, sometimes an array of function results, sometimes a string, is inconsistent.Please specify that
content
will be an array of strings, and if it's a single string for some test, wrap it in an array anyway. ( While you're at it, specify it can beundefined
. )Combining properties can be achieved with
Object.assign({},properties,CONSTANT)
or{ ...properties, ...CONSTANT }
. Later arguments overwrite keys of earlier arguments.That second syntax is just about what I would use to combine arrays, so I really don't think it's any less easy.
Loading more items...