Observed since 20 Oct, 18:55 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
2048 game utility
A lightweight and extensible Node.js utility for managing the core logic of the classic 2048 game. This utility includes board initialization, tile spawning, movement logic, and game-over detection - ideal for building 2048 game UIs, simulations, or reinforcement learning environments.
You can install this package using npm:
npm install 2048-danyo
const Twenty48 = require('2048-danyo');
const game = new Twenty48();
console.log(game.board); // Prints the initial board
Spawns a tile on a random empty square
game.spawnTile(game.board, true);
console.log(game.board); // Prints the board after spawning a tile
Returns a deep copy of the provided board
const boardCopy = game.copyBoard(game.board);
console.log(boardCopy); // Prints the copied board
Rotates a board 90 degrees counter clockwise
const rotatedBoard = game.rot90(game.board);
console.log(rotatedBoard); // Prints the rotated board
Performs a move in the specified direction, where:
L is leftR is rightU is upD is downgame.makeMove(game.board, 'L');
console.log(game.board) // Prints the board after moving tiles left
One of the conditions for the game to still be playable is for it to have at least one empty square.
const hasEmptySquare = game.hasEmptySquare(game.board);
console.log(hasEmptySquare); // true or false
One of the conditions for the game to still be playable is for it to have at least one pair of tiles that can be merged.
const hasMergableTiles = game.hasMergableTiles(game.board);
console.log(hasMergableTiles); // true or false
Checks for any remaining legal moves
const isGameOver = game.gameOver(game.board);
console.log(isGameOver); // true or false
Returns a string representation of the current board. Empty cells are shown as ..
const str = game.toString();
console.log(str);
Example Output
2..2
....
....
....
This project is licensed under the MIT License.
npm · 90 observations shown. Missing days are unknown.
| Date / source period | Value | Observed at |
|---|---|---|
| 2026-10-19 – 2026-10-19 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-18 – 2026-10-18 | 2 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-17 – 2026-10-17 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-16 – 2026-10-16 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-15 – 2026-10-15 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-14 – 2026-10-14 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-13 – 2026-10-13 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-12 – 2026-10-12 | 3 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-11 – 2026-10-11 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-10 – 2026-10-10 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-09 – 2026-10-09 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-08 – 2026-10-08 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-07 – 2026-10-07 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-06 – 2026-10-06 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-05 – 2026-10-05 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-04 – 2026-10-04 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-03 – 2026-10-03 | 3 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-02 – 2026-10-02 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-10-01 – 2026-10-01 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-30 – 2026-09-30 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-29 – 2026-09-29 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-28 – 2026-09-28 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-27 – 2026-09-27 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-26 – 2026-09-26 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-25 – 2026-09-25 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-24 – 2026-09-24 | 5 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-23 – 2026-09-23 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-22 – 2026-09-22 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-21 – 2026-09-21 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-20 – 2026-09-20 | 4 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-19 – 2026-09-19 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-18 – 2026-09-18 | 3 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-17 – 2026-09-17 | 37 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-16 – 2026-09-16 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-15 – 2026-09-15 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-14 – 2026-09-14 | 2 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-13 – 2026-09-13 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-12 – 2026-09-12 | 4 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-11 – 2026-09-11 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-10 – 2026-09-10 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-09 – 2026-09-09 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-08 – 2026-09-08 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-07 – 2026-09-07 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-06 – 2026-09-06 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-05 – 2026-09-05 | 2 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-04 – 2026-09-04 | 10 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-03 – 2026-09-03 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-02 – 2026-09-02 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-09-01 – 2026-09-01 | 2 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-31 – 2026-08-31 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-30 – 2026-08-30 | 6 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-29 – 2026-08-29 | 2 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-28 – 2026-08-28 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-27 – 2026-08-27 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-26 – 2026-08-26 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-25 – 2026-08-25 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-24 – 2026-08-24 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-23 – 2026-08-23 | 3 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-22 – 2026-08-22 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-21 – 2026-08-21 | 2 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-20 – 2026-08-20 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-19 – 2026-08-19 | 4 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-18 – 2026-08-18 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-17 – 2026-08-17 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-16 – 2026-08-16 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-15 – 2026-08-15 | 17 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-14 – 2026-08-14 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-13 – 2026-08-13 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-12 – 2026-08-12 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-11 – 2026-08-11 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-10 – 2026-08-10 | 6 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-09 – 2026-08-09 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-08 – 2026-08-08 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-07 – 2026-08-07 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-06 – 2026-08-06 | 2 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-05 – 2026-08-05 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-04 – 2026-08-04 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-03 – 2026-08-03 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-02 – 2026-08-02 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-08-01 – 2026-08-01 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-07-31 – 2026-07-31 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-07-30 – 2026-07-30 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-07-29 – 2026-07-29 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-07-28 – 2026-07-28 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-07-27 – 2026-07-27 | 0 | 2026-10-20T23:26:43.4875180Z |
| 2026-07-26 – 2026-07-26 | 4 | 2026-10-20T23:26:43.4875180Z |
| 2026-07-25 – 2026-07-25 | 5 | 2026-10-20T23:26:43.4875180Z |
| 2026-07-24 – 2026-07-24 | 2 | 2026-10-20T23:26:43.4875180Z |
| 2026-07-23 – 2026-07-23 | 1 | 2026-10-20T23:26:43.4875180Z |
| 2026-07-22 – 2026-07-22 | 0 | 2026-10-20T23:26:43.4875180Z |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 18:55 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:bca090b3ddeceef55e0314a5d4b95d53b25a64339c40bcdee842c81daa532e53