CLI implementaiton of the game "2048".
$ npx 2048-cli
$ git clone https://github.com/ozziexsh/2048.git $ cd 2048 $ npm i $ npm start
Testing done via jest
$ npm test
Tech stack is
The code is broken out into a few pieces:
- board.ts - This is the class that handles the position of numbers on the board as well as moving them around. Contains logic for combing numbers together however doesn't perform any special checks when calling the respective
- game.ts - This class contains a single board instance and performs more logic around the moves such as spawning new numbers.