Ad
  • Default User Avatar

    fix your indentation man

  • Custom User Avatar

    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.

  • Custom User Avatar

    Random tests aligned with changes in attributes type

  • Custom User Avatar

    Edited, now attributes is an object. I'll mark this suggestion as resolved as well as random tests

  • Custom User Avatar

    Better to not make attrib optional. content can be optional ( but won't be in Haskell ). Both can be empty though.

  • Custom User Avatar

    Ok, so we could transform the result in this form

    html([
        head([
            title(['Hello, world!']),
            script({
                type:'text/javascript',
                src:'js/index.js'
            }),
            link({
                rel:'stylesheet',
                href:'css/style.css'
            })
        ]),
        body([
            div({
                class:'this-is-a-class',
                id:'this-makes-me-unique'
            },['Hello, world!'])
        ])
    ])
    

    Where both attributes and content aren't required.
    I'll wait some feedback from you in order to make changes in Kata

  • Custom User Avatar

    Looking better. Existing solutions have been revalidated as passing, which is probably correct.

  • Custom User Avatar

    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 string content 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.

  • Custom User Avatar

    I am consistently getting some contents 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.

  • Custom User Avatar

    Added attributes in random tests. Unfortunately they are random string so they can be non-valid format for an HTML validation but in terms of testing they are valid.

  • Custom User Avatar

    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!

  • Custom User Avatar

    Excuse me, in fact inside the description I don't specify that content is an array, altought in the example it is shown, I'll edit this now. Function results are always string. For your second point content already is always an array. I will revise description to be more clear, thank you

  • Custom User Avatar

    Actually, 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 requireing 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 on GLOBAL 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.

  • Custom User Avatar

    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 be undefined. )

  • Custom User Avatar

    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...