#include <stdio.h>

void make_ppm_header(int wd, int ht);
void create_image(int wd, int ht, unsigned char r, 
	                              unsigned char g,
	                              unsigned char b);

int main()
{	/*width and height of the image*/
	int width = 400;
	int height = 400;

	/*Holds the RGB - red, green, and blue values*/
	unsigned char red = 255;
	unsigned char green = 0;
	unsigned char blue = 0;

	
	create_image(width, height, red, green, blue);

	return 0;

}

/*This function will create the ppm header for the file
 *notice there is no space between 255 and the newline character*/
void make_ppm_header(int wd, int ht)
{
	fprintf(stdout, "P6\n");
	fprintf(stdout, "%d %d 255\n", wd, ht);
}

/*This function will first call make_ppm_header, 
 *next it will create the RGB value for each pixel*/
void create_image(int wd, int ht, unsigned char r, 
	                   			  unsigned char g, 
	                   			  unsigned char b)
{
	int count = 0;
	make_ppm_header(wd, ht);
	/*You can use a for loop or a while loop to iterate through
	 *each pixel in the Width * Height image.*/

	while(count < (wd * ht))
	{
		fprintf(stdout, "%c%c%c", r, g, b);
		count++;
	}
}


