Skip to content

Instantly share code, notes, and snippets.

@bruceoutdoors
Created April 2, 2014 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bruceoutdoors/9933592 to your computer and use it in GitHub Desktop.
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++.
#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