Hot answers tagged

5

Don't hardcode values There are lots of magic values that you are using in your code, from the terminal velocity, the wall coordinates to the numbering of the walls. Try to give everything a name: declare constants for the coordinates and terminal velocity, and create an enum for the six faces of the enclosing box: enum Face { FACE_RIGHT, FACE_LEFT, ...


Only top voted, non community-wiki answers of a minimum length are eligible