generated html version of drawbar.cHOME

#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#include "math.h"
char *hgraph[] = {"█","▉","▊","▋","▌","▍","▎","▏"," "};
int main(int argc,char**argv){
	int w = 12;
	int val,j;
	int max = 100;
	if(argc >= 2)val = strtol(argv[1],0,0);
	if(argc >= 3)max = strtol(argv[2],0,0);
	if(argc >= 4)w = strtol(argv[3],0,0);
	for(j=0;j<w;j++){
		float r = ((float)val/max)*8*w-j*8;
		if(r>8){
			fputs(hgraph[0],stdout);
		}else if(r>0){
			fputs(hgraph[8-(int)(r+0.5)],stdout);
		}else{
			fputs(hgraph[8],stdout);
		}
	}
	return 0;
}