Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 1.61 KB

README.md

File metadata and controls

28 lines (21 loc) · 1.61 KB

Snake exercise

Logo

Why does this project exist?

This project can be used to test your own or someone else's problem solving and JavaScript/TypeScript skills.

What skills do i need for this exercise?

Although most of this project is made in NextJS, React, TypeScript and SCSS the only skill you'll need is vanilla JavaScript.

Goal of the exercise

This project contains most of the necessary code to create the game Snake. The only thing missing is the game logic. It's up to you to add the last bit of code in src/game-logic.ts.

Rules

  • You should try to complete this exercise by working in src/game-logic.ts, none of the other files need to be edited.
  • Don't cheat by looking at the implementation in src/game-logic.test.ts or src/solution/index.ts.
  • This project is made in TypeScript but you can write your implementation of the game logic in vanilla JavaScript. Be sure to keep an eye on the compiler errors as these might point out errors in your code.

Getting started

Start by installing the required npm packages by running npm install.

When this is done you can get started by running one of the following commands:

  • npm test to run the unit tests
  • npm run dev to start the project in development mode
  • npm run build to compile the project
  • npm run start to start the project in production mode (this will require you to build the project first)
  • npm run demo to start a demo with an implemented solution

Your game will be hosted on http://localhost:3000 when started.