Giter Club home page Giter Club logo

ek-week9-sudoku's Introduction

sudoku

Local installation

 git clone https://github.com/FACN7/ek-week9-sudoku.git
 cd ek-week9-sudoku
 npm i 

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

User journey

Well, it's a Sudoku game app, you can play it stright away, there are no opponents but your own mental capabilities. if you don't know what Sudoku is, the here's a nice Wiki TO PLAY IT CLICK HERE

dev journal

For this project we had to:

  • Use React
  • Fetch data from an API (in our case an unsolved Sudoku Array*)
  • Display said data into a form (a Sudoku form we made using React)
  • check the user (player) progress
  • Tests for UI and the game logic

What we did:

  • created a react app
  • created components SudokoTable(duh!),SubBoard(in this case it's just a row :)
  • CSS (yeah)

Stretch goals:

  • [] testing

new stuff we've learned

  • react

ek-week9-sudoku's People

Contributors

ebraheemabbas avatar okarem avatar

Watchers

James Cloos avatar Jamie Coe avatar

ek-week9-sudoku's Issues

Use clearer variable names

What exactly is idx? I see you use it in a couple of places (eg: here and here). At one point you pass it in as a row prop to <SubBoard>.

These names might make sense to you as the original author, but imagine you are an outside developer coming to this project for the first time, or you're just returning to the project after months or years. You have to waste time and cognitive energy trying to work out what these things are! Make it easy to understand by using helpful variable and function names that describe what they are / what they do. Don't worry about longer names (as long as they're not ridiculous).

Unnecessary use of `let`

You are using let for declaring/assigning new variables, when you should use const.

Example

Remember, you only need to use let when you are going to reassign the value of that variable later on. If the value will not change after the first time you assigned it, then you should use const.

This is the same even if the variable is an array and you are pushing new values inside. You would still use const. Eg:

const arr = []
arr.push('new value')

Great work πŸ”₯

Lots of impressive stuff!

  • Interesting use of Sudoku API, you've had to do some complex logic and it all seems to be working πŸ˜„
  • Very pleased to see you extracting larger logic functions into their own files in /utils πŸ‘This stops your components getting massive
  • Loving the count down at the start, and good to see the board is disabled until it finishes
  • You've done well at extracting different parts into React Components, which was one of main lessons this week.

The main improvement I'd suggest is working on the maintainability and readability of your code. Try to always imagine how it would feel for an outside developer to look at, and work on extracting sections of your code into functions with clear names to describe what they are doing. Also give variables clear names to describe what they are. This is crucial when you start coding professionally, in a team or by yourself - coming back to code after a while is often almost the same as being a stranger πŸ•΅

Also, if you want to develop this project further, think about writing tests for complex logic - you want to be sure that any future changes you make don't break anything!

Extract your code into functions for readability

Nice count down when the app boots up!

Why not tidy up your React.useEffect() in App.js by extracting code into functions to make it more readable? You'd end up with something like:

React.useEffect(() => {
    getBoard(url).then(data => {
      initialiseBoards(data, setiBoard, setBoard)
      startCountDown()
    });
  }, []);

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.