From 89b165504c98599839dfb8a8988f27e91db2dba2 Mon Sep 17 00:00:00 2001 From: epochqwert Date: Fri, 24 Apr 2015 03:56:26 -0500 Subject: added three little programs for generating dragon curve ascii-art. lineplot and turn2line can be used for other stuff, but some constants will need to be changed. also they were golfed. so have fun. --- src/bin/lineplot.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/bin/lineplot.c (limited to 'src/bin/lineplot.c') diff --git a/src/bin/lineplot.c b/src/bin/lineplot.c new file mode 100644 index 0000000..781a85a --- /dev/null +++ b/src/bin/lineplot.c @@ -0,0 +1,18 @@ +#include +#include +#define WIDTH 39 +#define HEIGHT 24 +char buff[WIDTH*HEIGHT*4]; +void draw_line(x1,y1,x2,y2) { + buff[(y1*WIDTH*2)+x1]='+'; + buff[(((y1+y2)/2) * WIDTH *2)+((x1+x2)/2)]= + (x1==x2)?'|':(y1==y2)?'-':((x1y2)||(x1>x2&&y1