July 26, 2011

Poor Man's Graphics

This is Poor Man's Graphics( or ProgramMers' Graphics). As I observe, some programmers are reluctant to use any graphics program. Whenever they want to explain some vector or geometric stuffs, they would rather do it in ASCII in source code comment.

If you are one of them, I tell you what, Inkscape or Google Draw is not that hard to use. I know I can't convince you, so instead I bring you the concept and the proof of concept of an Ascii to image/ graphics converter - Poor Man's Graphics(PMG).

The best part of it? It is interactive so type in the text boxes below now! And all source code is embedded in this HTML file. Tada- happy coding and happy commenting! remember to toogle 'insert' when necessary.

PMG can only parse the 2 specific types of graphics below. It took me longer than expected, 1 week, to complete the following demo. It is indeed a very good programming exercise. If you have already programmed many apps, games and get bored with programming, then you should try to implement an Ascii art parser like me. It integrates basic concepts of computational pattern matching, geometry and graphics.

Most importantly, there are so many styles you can try!

small challenge

BIG challenge

No comments:

Post a Comment