Skip to content

Conversation

@Shrinidhibijapur
Copy link

Summary

Improved the asteroid collision program by fixing minor logic issues and enhancing interactivity.

Changes Made

  • Fixed logical errors in collision handling (equal-size and chain collisions).
  • Added user input using loops for dynamic asteroid array entry.
  • Improved output formatting to clearly show final asteroid states.
  • Cleaned up code structure for readability.

Benefits

  • Now handles all edge cases correctly.
  • Accepts any size of input dynamically from the user.
  • Easier to test multiple scenarios interactively.

Example

Input
5
5 10 -5 8 -8

Output
After collisions: 5 10

@Ghost4474 Ghost4474 force-pushed the main branch 27 times, most recently from dcbfd4d to 8787588 Compare October 19, 2025 18:50
@Ghost4474 Ghost4474 force-pushed the main branch 30 times, most recently from dc164a2 to d6370e3 Compare November 9, 2025 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants