Repository Details
Shared by
HelloGitHub Rating
10.0
2 ratings
2048 Game Based on Bitwise Operations
Past 6 days Received 0 stars ✨
Use arrow keys to explore dates, Home and End for the first and last date, Escape to dismiss.| Date | Star | Daily change |
|---|---|---|
| 周日 | 294 | — |
| 周一 | 294 | 0 |
| 周二 | 294 | 0 |
| 周三 | 294 | 0 |
| 周四 | 294 | 0 |
| 周五 | 294 | 0 |
294
Stars
No
Chinese
Shell
Language
No
Active
1
Contributors
2
Issues
No
Organization
None
Latest
14
Forks
None
License

This is a classic 2048 game implemented through bitwise operations. It consists of only one file (.bash), with zero dependencies and less than 200 lines of code. Different from the common way of simulating the game board with a two-dimensional array, this project cleverly uses bitwise operations to manage the game state and logic. The entire 4x4 game board is compressed and stored in a 64-bit integer, and all movements, merges and generations are achieved through bit operations.
Comments
Rating:
No comments yet