GithubHelp home page GithubHelp logo

alvaroisrael / paint-bucket-simulator Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 171 KB

๐Ÿชฃ A simple typescript program to solve the flood fill algorithm!

License: GNU General Public License v3.0

TypeScript 98.51% JavaScript 1.49%
floodfill algorithms-and-data-structures recursion typescript

paint-bucket-simulator's Introduction

Paint Bucket Simulator

Paint Bucket Simulator Logo

A simple typescript program to solve the flood fill algorithm!

Challenge โ€ข Technologies Used โ€ข How To Use โ€ข How To Test โ€ข License

Made with โค๏ธ by Alvaro Israel ๐Ÿ‘๐Ÿป Get in Touch!

๐Ÿ’ก Challenge

This challenge consists of implementing the behavior similar to the 'paint bucket tool' of MS-Paint. The program should hold an array of symbols and characters representing the shape of an image. With each array value representing a pixel in that image. Each pixel should have a color and, identical characters or symbols would represent the same color. For example: The following 4x6 matrix represents the image of the letter 'P', collored by '#', having the background color of '.'.

.###..
.#..#.
.###..
.#....

The program should recieve one pixel (from that image), a new color, and then be able to paint the correct adjacent region filled with that same pixel's color, exactly like the 'paint bucket tool' of MS-Paint does.

Examples:
Pixel (0, 1) and new color 'o':

# Previously:
.###..
.#..#.
.###..
.#....

# Afterwards:
.ooo..
.o..#.
.ooo..
.o....

Pixel (1,3) and new color 'o':

# Previously:
.###.
.#..#.
.###.
.#....

# Afterwards:
.###..
.#oo#.
.###..
.#....

Pixel (1,3) and new color '#':

# Previously:
.###..
.#..#.
.###..
.#....

# Afterwards:
.###..
.####.
.###..
.#....

๐Ÿ† Technologies Used

๐Ÿ’ป How to Use

To clone and run this application, you'll need Git and Node.js (which comes with npm) installed on your computer. From your command line:

# Clone this repository
$ git clone https://github.com/AlvaroIsrael/paint-bucket-simulator.git

# Go into the main app folder
$ cd paint-bucket-simulator

# Install dependencies
$ yarn install

# Run the app
$ yarn start

๐ŸŽฏ How to Test

# Open up terminal and run
$ yarn test

Code coverage html report can be found at:

./paint-bucket-simulator/coverage/lcov-report/index.html

๐Ÿงพ License

This software is under GNU General Public License v3.0. See LICENSE for more details.

paint-bucket-simulator's People

Contributors

alvaroisrael avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

paint-bucket-simulator's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.