#game-engine #validation #move #2048 #basic #wasm-bindings #2048-game

twothousand-forty-eight

a basic engine and move validator for the game 2048

27 releases (15 breaking)

0.22.1 Sep 3, 2023
0.21.1 Jul 28, 2023
0.17.0 Feb 16, 2023
0.16.1 Nov 7, 2022
0.5.0 Jul 29, 2022

#635 in Game dev

Download history 75/week @ 2024-07-23 27/week @ 2024-07-30 1/week @ 2024-09-17 48/week @ 2024-09-24 8/week @ 2024-10-01

141 downloads per month

MIT license

93KB
2.5K SLoC

twothousand-forty-eight

a basic engine and move validator for the game 2048

This is a library written in rust, the documentation can be found at docs.rs.

The most up-to-date version can be downloaded from crates.io or the wasm version from npm.

See LICENSE for information on the used license (MIT).

How-tos

Testing

Run cargo test to run the default tests.

Run cargo test -- --ignored instead to run expensive tests (such as validating 10 000 real games)

Building

Run cargo build --release to build

Publishing

Run the provided publish.sh to publish the package to crates.io and the wasm bindings to npm. You need to have wasm-pack installed in order to build the npm package.


lib.rs:

a basic engine and move validator for the game 2048

Includes wasm bindings generated with wasm_bindgen

Dependencies

~2.3–5MB
~95K SLoC