This project can be used to test your own or someone else's problem solving and JavaScript/TypeScript skills.
Although most of this project is made in NextJS, React, TypeScript and SCSS the only skill you'll need is vanilla JavaScript.
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
.
- 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
orsrc/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.
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 testsnpm run dev
to start the project in development modenpm run build
to compile the projectnpm 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.