Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- My task.
- For some simulations, a 2D space of real numbers is required (e.g., N-body problem, Cannonball). However, when working in a terminal with ASCII characters, you have a 2D space of integers (a grid, like a chessboard). You can implement the simulation in the "background" in the 2D space of real numbers, and only when it needs to be displayed to the user, round the positions of objects to integers so that the objects in the simulation can be placed in a 2D grid of ASCII characters.
- Light and shadows - One position in the grid is a source of light. Randomly generated "stones" that obstruct the light are placed elsewhere on the grid. Show how the surroundings are illuminated, taking into account these obstacles.
Advertisement
Add Comment
Please, Sign In to add comment