Created
April 2, 2014 13:00
-
-
Save bruceoutdoors/9933592 to your computer and use it in GitHub Desktop.
A tiny console program that plots a sine graph animation. Runs in VC++.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _USE_MATH_DEFINES | |
#include <iostream> | |
#include <cmath> | |
#include <windows.h> | |
using namespace std; | |
int main() | |
{ | |
for (int i = 0; i < 100000; i++) { | |
int j = rint(sin((i * 12) * M_PI / 180) * 19.8) + 30; | |
for (int k = 0; k < j; k++) { | |
cout << '*'; | |
} | |
cout << endl; | |
Sleep(50); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment