3

Launch to Orbit automated

 1 year ago
source link: https://www.codeabbey.com/index/forum_topic/a94766139517adab0183c1636310a778
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Launch to Orbit automated

Back to General discussions forum

gardengnome     2022-11-05 19:58:56
User avatar

Hi Rodion,

Thank you for the 'Sputnik' problems.

Submitting a pilot program, I get the following error message: End of trajectory is not horizontal (error -0.881219 degrees) for goal H=370 V=8700.

Testing the same pilot program via the BASIC button, I get the following output from the provided BASIC program: H: 374875 V: 8602 direction error: -0.38121924984468 degrees.

The angles are clearly different. Interestingly, they are different by 0.5. I assume this comes from the following formula: err * 180/pi + 0.5 which translates the radiant error into a degree error but adds 0.5. My guess is that the checker does not include this +0.5 element, but I am not entirely sure where this part comes from anyway. Maybe it's a leftover from previous int(<something> + 0.5) rounding. Somehow I feel the +0.5 should be removed in the BASIC code (even though I've used it so far to match the logic).

Rodion (admin)     2022-11-06 06:18:42
User avatar

Mathias, Hi! Thanks a lot for checking this, and for your attentiveness which allowed to have it fixed very quickly!

Blame on me! It is exactly "leftover from previous" version of the code which printed result rounded. The checker uses the copy of the code with minor modifications and I perfectly remember when I spotted this dangling +0.5 and removed it but seemingly forgot it in the published code for both problems.

I'm much sorry for I see failed attempts by you and Clive :(

P.S. to clarify - the code in the checker didn't have mistake in both problems, so it was not altered.

Rodion (admin)     2022-11-06 11:39:46
User avatar

Well... checker hides specific error (to prevent possible "reverse-engineering by error messages" - though perhaps it is unnecessary) - but the failure is about execution limit reached.

I modified the checker to catch and show such situation specifically. However of course it is not good that rem statements are included in execution (especially in counting). I'll try to take care of it. Sorry and thanks for sharing this interesting discovery!

Please login and solve 5 problems to be able to post at forum

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK