Ad
  • Custom User Avatar

    Ha, I can't even remember.

  • Default User Avatar

    point free! Nice :)

  • Default User Avatar

    Not only did I not know about traverse, I had forgotten that the semicolon syntax could be used in where clauses!

    Really nice solution, even with the neat layout, too.

  • Custom User Avatar

    Bugfix: include "CD" and "XL".

  • Custom User Avatar
  • Custom User Avatar

    I am having trouble submitting my solution. It passes the default "Your Test Cases" test -- which is basically just a check that the code compiles.

    However, when I try to submit, it times out at 6000ms. I don't know what to do at this point because submission testing is completely opaque.

    This really sucks because I spent quite a bit of time learning this singleton stuff to get everything to work...

    Can someone help me figure out why the tests are timing out?

  • Custom User Avatar

    Nullvoid,

    Can you please post a brief explanation of this algorithm? I understand the Haskell code completely, but I don't know why the underlying formulas work.

    If not an explanation, can you post a link to another resource that explains the algorithm?

    Thanks.

  • Custom User Avatar

    My solution grows the spiral from the center by adding layers at each iteration. This produces a valid spiral that does not touch itself.

    However, my solution is rejected by the test-suite for two reasons:

    1. The test assumes that all spirals have 00000 as the first row. Some of my spirals instead start with 11111. I don't see how that should invalidate my spirals.
    2. For even numbers, either the 0 or the 1 spiral has a double-thickness segment in the middle. Spirals like mine that are grown from the center will always have the same center. However, the test-suite's even spirals alternate rotating the center by 180 degrees.

    I added special functions to my solution that convert my spirals to ones accepted by the test-suite. However, I think it would be better to expand the test-suite to accept inverted spirals (1 <-> 0) and rotated even spirals.