This is a basic drawing tool written in PHP as a part of a code challenge. Hurry up to clone it because I will remove it.
PHP needs to be a minimum version of PHP 5.3.9
- C w h Create a new canvas of width w and height h.
- L x1 y1 x2 y2 Create a new line from (x1, y1) to (x2, y2). Only horizontal and vertical lines supported.
- R x1 y1 x2 y2 Create a new rectangle whose upper left corner is (x1, y1) and lower right corner is (x2, y2).
- B x y c Fill the entire area connected to (x, y).
You can run the drawing tool with the following command:
$ cd path/to/DrawingTool/
$ ./bin/drawingtool
You can run the unit tests with the following command:
$ cd path/to/DrawingTool/
$ ./vendor/bin/phpunit