The MIT License (MIT)
Copyright (c) 2016 Stephan Kristyn (meshfields.de)
http://meshfields.de/mit-license/
With this tool you can draw on console in Linux. It uses Python.
First fully working version
Moved all test calls over to test.py and fixed some tests
unittest
: (for TDD)
sys
: (basic python interpreter methods)
regex
: (for user input sanitation)
You can draw lines, rectangles and use bucket fills after you declared a canvas.
Start: ./main.py
Tests: ./test.py
Development: methods.py
and helpers.py
...............................
. .
. .
. x .
. x .
. xxxxxxxx x .
. xoooooox x .
. xoooooox x .
. xoooooox x .
. xoooooox x .
. xoooooox x .
. xoooooox x .
. xxxxxxxx x .
. x .
. x .
. x .
. x .
. .
. .
. .
...............................
[Line] [Canvas] [Rectangle] [Bucketfill] [Quit]
This is what you want to see:
Unit Tests
> Should plot a 5,9 Canvas
> Should bucket fill a 20,4 Canvas with o
> Should substitute tuples in pixels
> Should Get Color Of Coordinates
> Should substitute tuples in pixels
> Should Set Color for a specific Coordinate
> Should substitute tuples in pixels
> Should Init Canvas Area 20,4 with ' '
> Should get colored Canvas
> Should get colored Rectangle
> Should colorise the Coordinates
> Should get Coordinates of Line
10 Tests passed.
Also, in methods.py
:
testDrawFourNeighbour()
remaining because of testing of global pixels
. (which can't be returned from recursive function for testing purposes)
- Decided against nCurses or gnuPlot because of requirement to not use a library
- Emphasised on self-explanatory Code and helpful UX/UI
- 1 remaining test in methods.py
- Lines and Rectangles can be drawn upon canvas border, this may be unwanted, but spared me some input checks.
- Re-Write as Class for cleaner testing
- Then make unit tests more autonomous
- Modularise further
Questions and Feedback to nottinhill@ecomail.at.