Ad
  • Custom User Avatar

    I think this is all working now.

  • Custom User Avatar

    Phew! Yeh it seems to be working now! I think some of my maths was wrong in the original solution. Sorry it was so drawn out, I was about to give up!

  • Custom User Avatar

    Obviously I have already done what you suggested. I have put in easy solutions and tested them against the results and on my side they seem to be all correct. Sorry to trouble you.

  • Custom User Avatar

    The hour hand should now move in increments of a minute and then minute hand should just move in increments of a minute as it should have been doing so before.

  • Custom User Avatar

    I think I have fixed this now, could you give it a test and see what happens?

  • Custom User Avatar

    The hour hand should now move once per minute.

  • Custom User Avatar

    Okay, I removed the floor's. Could you tell me how assertApproxEquals works, because it seems to cause some issues with my Example Test Cases now. What is the accuracy that it expects from the answer?

  • Custom User Avatar

    Yes I realised this is a problem. I have not factored in that the hour hand with move to the location of the minutes. I'll fix this asap. Thanks!

  • Custom User Avatar

    Okay, I think I've fixed this now. I have floor'ed the final answer given by the solution so it should match up with the requested answer. Could you give me your solution so I can test it again and see if it works with yours?

  • Custom User Avatar

    Okay I've put the new test cases in so it should test for an approximate answer. Do you know what level of approximation it tests for, like what are the limits?

  • Custom User Avatar

    Could you give me an example of how to use Test.assertApproxEquals with object properties, so that I can compare all the seperate values for each hand?

  • Custom User Avatar

    Ah yes I see what you mean. I will try and code it so that the hour hand has to be in the correct position depending on the number of minutes to the nearest minute and the minute hand with just click to the nearest minute. Do you think that would be a good solution?

  • Custom User Avatar

    So the values are turned into integers with Math.floor when you calculate the position using the trigonometric function. There was an issue in there with the Y values being the wrong way around (positive when they should be negative and vice versa), but this should be fixed now. Perhaps try again and see if you can get solve it.

  • Custom User Avatar

    I had stated in the description that it is set to cartestian co-ordinates but the code didn't represent this. This should be fixed now. Y should be positive when heading north and negative when heading south from (0,0). I also switched it from assertSimilar to assertDeepEquals, thanks.

  • Custom User Avatar

    I have put in a statement now that will ignore all negative 0 values and just return them as 0, so -0 should be ignored.

  • Loading more items...