2048-cli 中文文档教程
2048
游戏“2048”的 CLI 实现。
Playing
快速:
$ npx 2048-cli
来自来源:
$ git clone https://github.com/ozziexsh/2048.git
$ cd 2048
$ npm i
$ npm start
Testing
测试通过开玩笑
$ npm test
Contributing
PR 的欢迎!
Tech stack 是
- Node
- TypeScript
- React
- ink
- jest
- Prettier
- ESLint
代码被分解成几块:
- 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
moveXyz
methods. - game.ts - This class contains a single board instance and performs more logic around the moves such as spawning new numbers.
2048
CLI implementaiton of the game "2048".
Playing
Quickly:
$ npx 2048-cli
From source:
$ git clone https://github.com/ozziexsh/2048.git
$ cd 2048
$ npm i
$ npm start
Testing
Testing done via jest
$ npm test
Contributing
PR's welcome!
Tech stack is
- Node
- TypeScript
- React
- ink
- jest
- Prettier
- ESLint
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
moveXyz
methods. - game.ts - This class contains a single board instance and performs more logic around the moves such as spawning new numbers.
更多
你可能也喜欢
- 2d-quadtree-js 中文文档教程
- @00f100/jimple 中文文档教程
- @0x12b/dotty-cli 中文文档教程
- @11ty/eleventy-plugin-syntaxhighlight 中文文档教程
- @1hive/connect-conviction-voting 中文文档教程
- @33cn/vue-cashier 中文文档教程
- @3beeepb/react-native-keyboard-dismiss 中文文档教程
- @8sistemas/design-system 中文文档教程
- @9renpoto/tslint-config 中文文档教程
- @a-martynovich/janus-gateway 中文文档教程