Skip to content

A solution to the Pipes game challenge as part of frontend recruitment process

Notifications You must be signed in to change notification settings

wallybeetles/game-center

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pipes Puzzle

This project was bootstrapped with Create React App.

Level Passwords Obtained

  • Level 1: JustWarmingUp
  • Level 2: DefinitelyWarm
  • Level 3: GettingTooHot

Known Limitations

Negative scenarios

There was no error handling added.
The application does not handle any invalid inputs or unexpected behavior by the user.

Autosolver algorithm

The autosolver will be executed when the Hint button is clicked.

Please note however that this will not solve the entire puzzle.
Instead, it will only solve most of the pipes (straight-lines, elbows, and tees) along the edges of the board.
It will also solve single-ended or straight-line pipes that are adjacent to cross pipes.

Key Decisions

State management

At first, I was not considering to use an external state management library as I belive that I would be able to mannage the state inside the components themselves.

But after reading this line from the instructions,

If possible, your design should be such that makes adding other similar games less difficult.

I have decided to use Redux Toolkit, which holds the state that could possibly be shared by other components (or new games) as the applicatin grows.

This makes the application more dynamic and highly scalable.

To add a new game, simply add a new object inside the games array in the games.ts file, and then develop the components or reuse existing components necessary for the new game.

Design

I have no experience creating something with Canvas 2D or WebGL yet (but I am very much willing to learn it!), so I just went with creating simple strokes in SVG for visual representation of the pipes.

The SVG files are located in the public assets folder.

Steps to Launch

Live demo

Go to the live website deployed in Netlify.

To run in development mode

  1. Clone the repository: git clone https://github.com/sjkayle/frontend-pipes.git

  2. Go to the directory: cd frontend-pipes

  3. Install the node modules: npm install

  4. Run the application: npm start

  5. Open http://localhost:3000 to view it in the browser.

About

A solution to the Pipes game challenge as part of frontend recruitment process

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published