Ad
  • Custom User Avatar

    Javascript doesn't throw array index out of bounds exceptions. It simply returns undefined.

    Since undefined is not equal to any possible value of opposite[dir], this will always evaluate false on the first run of the loop.

  • Default User Avatar

    it doesnt; it pushes on the first run not pop

  • Custom User Avatar
  • Custom User Avatar

    Yep. I moved it back to draft.
    I actually believe the more clear requirements defined as part of a solution than the easier because thats less assumptions I have to make and less things I have to worry about but I guess that's just up to an individual's personal preference. Anyway, I get ya point ;).

  • Custom User Avatar

    :+1:

    (yes, about the performances, the other one might be a bit faster, but the thing is: what makes it a bit harder is to exactly follow the requirements)

    (EDIT: you should put this one to draft again, in the meantime)

  • Custom User Avatar

    Ok, I'll work on the other one and we'll see about that. It appeared to me that the other kata contained rules that would allow the code to invalidate a solution sooner (i.e. in doing less work) but I'll do a comparison and let ya know. Thanks.

  • Custom User Avatar

    No, in fact yours is easier to implement because you have less constraints (but that make it a bit more interesting imo, since that allows different approaches). The thing is: the general implementation stays the same. Those differences are only "border effect".

  • Custom User Avatar

    I don't know. I had checked out that kata before I tried to author my own and I really think that kata has some rules/constraints in it that make it a little bit different of a problem. Actually I think it's easier to solve due to some of it's constraints that this one doesn't impose.

  • Custom User Avatar

    Ok, let me check it out.

  • Custom User Avatar

    Damn, there is a bigger problem:

    myjinxin katas #003 : Crossword puzzle

    => your kata is actually an almost perfect duplicate (there are some tiny differences, but nothing to make it different enough and this one has already rules for several solutions and surely have random tests already (I don't do JS so I cannot check for that, tho)). So it would actually be better that you unpublish yours, then solve the other and do its java translation... Damn, too bad...

  • Custom User Avatar

    Ok, thanks. I think I get the idea of how to implement the random tests and I'll work on that next. Speeding up my solution might be a little more challenging as that's the reason I think this is a good kata. It should probably be a 4 kyu but I didn't want to scare off code warriors with that rating. So far my algorithm passess all the tests I've made within the timeout interval but as the list of words grew, it was starting to time out so I had to scale it down a little.

    What exactly did you mean by "this "pseudo implementation" do not garantee that solutions will be unique, tho (even if it's probable)."? I would think that if I were to build the list of unique words and I were careful about the words generated, this would guarantee that no two solutions would exist for any one crossword problem. This might actually take more than just checking that the words were all unique so I'm open for ideas. Perhaps maybe making each word space size unique and doing some additional tricks with the lettering of the words might help (for the random tests)?

  • Custom User Avatar
    /---------------------------\
    |    MANUAL NOTIFICATION    |
    \---------------------------/
    
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    How would I go about implementing the random tests? Could use a little help on that one. lol

  • Custom User Avatar

    Good catch. I appreciate the review. Somehow I made a bunch of updates last night and couldn't get the code to re-publish so some of them were lost because when I tried to re-publish again this morning, I ommitted a few of the updates.

  • Loading more items...