https://github.com/zapix/game2048lib
Librarry for playing 2048(http://gabrielecirulli.github.io/2048/) from python
https://github.com/zapix/game2048lib
Last synced: 8 months ago
JSON representation
Librarry for playing 2048(http://gabrielecirulli.github.io/2048/) from python
- Host: GitHub
- URL: https://github.com/zapix/game2048lib
- Owner: Zapix
- License: gpl-2.0
- Created: 2014-06-13T11:46:23.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-06-13T14:46:05.000Z (over 11 years ago)
- Last Synced: 2025-01-10T00:15:23.429Z (9 months ago)
- Language: Python
- Size: 160 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
game2048lib
===========Library for playing 2048(http://gabrielecirulli.github.io/2048/) from python
Setup library
-------------```
$ pip install git+https://github.com/Zapix/game2048lib
```Example of usage
----------------```python
>>> from game2048lib import Game2048
>>> game = Game2048()
>>> game.move_left()
>>> game.score
4
```Documentation
-------------*game2048lib.Game2048* - class of game. Game starts when creates instance of this class
*game2048lib.Game2048.grid* - current grid of game. List of list. example:
```python
>>> game.grid
[
[4, None, None, None],
[2, None, None, None],
[None, None, 4, None],
[None, None, None, None]
]
```*game2048lib.Game2048.score* - current score of game
*game2048lib.Game2048.start_new_game()* - method for starting new game
*game2048lib.Game2048.move_up()* - move up
*game2048lib.Game2048.move_left()* - move left
*game2048lib.Game2048.move_down()* - move down
*game2048lib.Game2048.move_right()* - move right