Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- #include <time.h>
- #include <windows.h>
- using namespace std;
- int main()
- {
- string dotSymbol = "Û";
- string dotPoint = dotSymbol;
- string eSpace = "";
- string spacer[] = {"²", "±", "°"}; // "²", "±", "°"
- int i;
- int sTime = 20;
- int lWidth = 1;
- int spacerLength = sizeof(spacer) / sizeof(spacer[0]);
- srand (time (NULL));
- // Check and set user-defined "line" width
- // Set limits
- cout << "Line width (1-5): ";
- cin >> lWidth;
- for (int w = 1; w < lWidth; w++) {
- if(lWidth < 1) {
- break;
- }
- dotPoint += dotSymbol;
- if (dotPoint.length() >= 5) {
- break;
- }
- }
- // Start printing for eternity!
- while(true) {
- eSpace = "";
- int random = rand() % 70;
- // Up up, and away!
- for(i = 0; i < random; i++) {
- if(i > 0) {
- eSpace += spacer[rand() % spacerLength];
- Sleep(sTime);
- cout << eSpace + dotPoint << endl;
- }
- else cout << dotPoint << endl;
- }
- // What goes up, must come down
- for(int j = i; j > 0; j--) {
- string decSpace = eSpace.substr(0, i-1);
- i--;
- Sleep(sTime);
- cout << decSpace + dotPoint << endl;
- }
- }
- }
- // End of tardcode
- // TODO: Error handling... Naaah.
Add Comment
Please, Sign In to add comment