Skip to content

amitgiri0001/nodejs-cli-paint

Repository files navigation

NodeJs CLI Paint

A basic Typescript base solution to provide paint-like features through command line.

Content

Features

Create Canvas

create canvas Enter the height and with of the canvas to create a virtual canvas like this.

Drawing Options

Options The following options will be given are available to play around. You can re-create new canvas or quit seamlessly.

Line

Line With the given coordinates of x1, y1 as starting point, x2, y2 as end, the line will be plotted inside the canvas accordingly.

Rectangle

Rectangle Similar to the line coordinates, the rectangle will be plotted from top left corner (x1, y1) to bottom right corner (x2, y2).

Color

color Now! we won't have "real colors" here but we can choose a characters to paint it. I chose *.

The x1 and y1 coordinates will decide which section will be painted. The behavior is similar as any other painting application. It respects the borders and does not overflows the color.

Let's try one more time

color This time the chosen coordinates were outside the drawing area.

Get Started

Installation

npm i

Start

npm start

Test

npm test

show code coverage

About

A basic Typescript base solution to provide paint-like features through command line.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published