Ad
  • Custom User Avatar

    Why'd you think Math is not involved in programming?

    We shouldn't just blindly train and learn languages, we should also train and learn not to be a stupid code monkey who can only implement the apparent. In this regard, mathematics and other logical skills are highly relevant.

    Stay competitive ;-)

  • Default User Avatar

    Problem solving skills are programming skills, though. If going by the book doesn't solve your problem you have to think again.

  • Default User Avatar

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

  • Custom User Avatar

    This is a math problem, not a tool for learning Haskell. It misleads students because the idiomatic Haskell solution works fine for the small tests provided but falls apart on the massive integers tested when submitting.

  • Custom User Avatar
  • Custom User Avatar

    I agree, thanks for fixing my Object.create call, schyzoo

  • Custom User Avatar

    Started approaching this from a loop and inspect prototype chains, which was a no-go. Took this one off-line and just thought about it for a while. Reminisced on scope and this and the CoffeeScript @. Came back for a retrain, and bam!, it just worked.

  • Custom User Avatar

    The instance variable for the Singleton should be private; no public properties except those inherited from Object.

    I also agree very strongly with spicydonuts that the returned instance should pass var obj = new Singleton();Test.expect(obj instanceof Singleton)

  • Custom User Avatar

    This really shouldn't pass if the returned instance isn't actually an instance of a Singleton, i.e. passes an "obj instanceof Singleton" test.

  • Custom User Avatar

    Add more descriptive test errors, like printing the comment above each test case as the test case message.