- Visual Studio 2019
- DotNet5 Framework
- Acces to public Nuget api
- Xunit along with Xunit runner for Visual Studio
Right click on solution and click build soultion.
- Set ConsoleCanvas.Runner as startup project.
- F5 to run.
- Build the project.
- Run tests using Visual Studio Test Explorer.
- Canvas dimension should not exceed Max dimension.
- All features are defined through abstraction under ConsoleCanvas.Core/*.
- All features are implemented through abstraction under ConsoleCanvas.Impl/*.
- You can only create implemention using the CanvasManagerBuilder.
- CanvasManagerBuilder exposes various methods to hook various implementations.
- CanvasManagerBuilder will allow you to extend features with new commands using RegisterCommandExecutor method.
- Need for more drawing commands. This can be achieved using CommandExecutorBase class.
- Need for undo feature. This can be achieved using IUndoPreviousCommand interrface.
- Commnads can be case insensitive and can also contain whitespaces.
- All types of lines can be drawn - horizontal, vertical, diagonal etc.
- Undo feature provided for Line commmand only.
Command | Description |
---|---|
C w h | Should create a new canvas of width w and height h. |
L x1 y1 x2 y2 | Should create a new line from (x1,y1) to (x2,y2). Currently only horizontal or vertical lines are supported. Horizontal and vertical lines will be drawn using the 'x' character. |
R x1 y1 x2 y2 | Should create a new rectangle, whose upper left corner is (x1,y1) and lower right corner is (x2,y2). Horizontal and vertical lines will be drawn using the 'x' character. |
B x y c | Should fill the entire area connected to (x,y) with "colour" c. The behavior of this is the same as that of the "bucket fill" tool in paint programs. Value "c" should be an integer where 0 <= c <= 15. |
Q | Should quit the program. |