You love watching the snow falling outside, but you know it won't be snowing much longer. You could take a video, but decide to make a snow animation because ... um ... you need to practice your animation skills!
Snow
Snow is simply the *
symbol here. Half of the snow moves at 1
char per frame, while the other half moves at 0.5
chars per frame. The program ends when all the snow reaches the bottom of the screen. The viewing area you will be using is 80x25
. You will have 100 snow flakes to output, half fast, and half slow.
Every frame you will dispense 4 flakes, 2 fast and 2 slow ones, at random locations at the top of the viewing area, until you have used all 100. The slow flakes can move either move the first frame, stay still the next, or stay still the first frame, and move the next, it doesn't matter. Overlapping flakes don't have anything special, just the *
like the rest.
Other notes
- You must make a full program, no functions here.
- Your program must run close to 10fps (+-1 frame per sec).
- You can assume the console is the same size as the viewing area.
- Each frame you must remove the previous output, either by pushing all previous output off the top of the console, or by clearing the output completely.
Example
To make this shorter this just outputs 2 flakes per frame (1 fast, 1 slow), only 20 flakes will be outputted, and the viewing area is 20x5
.
Frame 1:
* *
Frame 2:
* * *
*
Frame 3:
* * *
* *
*
Frame 4:
* * *
* **
*
*
Frame 5:
* * *
* * *
**
*
Frame 6:
* **
* * *
* * *
*
Frame 7:
* **
* **
* * *
* *
Frame 8:
* **
* * *
* * *
* *
Frame 9:
* * *
***
* * *
* * *
Frame 10:
* **
* * *
* * *
* * *
Frame 11:
*
* * *
** *
* * *
Frame 12:
* *
* * *
* * *
Frame 13:
*
* *
** *
Frame 14:
* *
* *
Frame 15:
*
* *
Frame 16:
* *
Frame 17:
*
If you want some snow/rain confusion and clean code, go here