Monday July 21, 2014
This problem challenges you to create a program in C or Fortran that simulates the described phenomenon.
Particles in a 2-D environment move in single directions and bounce off walls and each other. Particles move diagonally (Northeast, Southeast, Northwest, or Southwest), one square per time step, with no change in velocity. 20 particles are initially placed in an environment in random positions, moving in random initial directions (Northeast, Southeast, Northwest, or Southwest). The particles move for 5 time steps, and the environment is 11 squares wide by 12 squares high.

To help with validation and verification of your program, you must include a simple text-based or other kind of visualization that shows each time step of the simulation, e.g. using "o"s to represent particles, "|"s to represent vertical walls, "-"s to represent horizontal walls, and " "s to represent empty spaces.
Show solution
Challenge Resources:
©1994-2020   |   Shodor   |   Privacy Policy   |   NSDL   |   XSEDE   |   Blue Waters   |   ACM SIGHPC   |   feedback  |   facebook   |   twitter   |   rss   |   youtube   |   XSEDE Code of Conduct   |   Not Logged In. Login