https://github.com/kahlery/2d-terrain-map
🗺️ cli simulation: gravity effect on the objects in the given terrain on a 2d height-map.
https://github.com/kahlery/2d-terrain-map
cpp cpp17 vector
Last synced: 9 months ago
JSON representation
🗺️ cli simulation: gravity effect on the objects in the given terrain on a 2d height-map.
- Host: GitHub
- URL: https://github.com/kahlery/2d-terrain-map
- Owner: kahlery
- Created: 2024-01-16T15:21:32.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-16T15:21:34.000Z (over 2 years ago)
- Last Synced: 2025-09-12T04:51:11.240Z (10 months ago)
- Topics: cpp, cpp17, vector
- Language: C++
- Homepage:
- Size: 262 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
[]()
# [**`C++`**]()
> Basic C++ programs for simulating the gravity effect on the objects in the given terrain.
> The idea is to simulate the gravity effect on the objects in the given terrain. The terrain is represented by a 2D array where the value of each cell is the height of the terrain. The objects are represented by a 2D array where each cell is the mass of the object. The gravity effect is simulated by moving the objects down by one cell at each time step. The objects are not allowed to move through the terrain. If an object is at the lowest level of the terrain, it will stay there. If an object is at the same level as the terrain, it will move down by one cell. If an object is at a higher level than the terrain, it will fall down until it reaches the terrain. The simulation stops when all objects have reached the lowest level of the terrain. The program will read the terrain and the objects from a file. The program will print the terrain and the objects at each time step. The program will also print the number of time steps required for all objects to reach the lowest level of the terrain.