// Converts degrees to radians
double radians(int degrees);
// Maps a value to a range
// For changing your results of -1 - 1 to 0 - 80 (the console width)
// (Figuring out the position of the *)
// Called like: int result = map(0 , 80,-1.0, 1.0, sin( radians(60) ));
int map(int viewLow, int viewHigh, double dataMin, double dataMax, double data);
// Print a line
// given the position of the astericks, print the line with a '|' in the middle
void printLine(int astericksPos, int linePos = 40);
Main would be:
1 2 3 4 5 6 7 8 9 10 11
int main(void)
{
for (int i = 0; i < 360; i++)
{
double rads = radians(i);
double value = sin(rads);
int mapped = map(0, 80, -1.0, 1.0, value);
printline(mapped);
}
return 0;
}
The function declaration only states that there is something called "hello", and that it takes no arguments. The Definition is where the actual code of the function goes.