Python implementation of the JavaScript package 'tetris-fumen'
Project description
py-fumen-py
More Python-ish Python implementation of Knewjade's tetris-fumen
Original project: hsohliyt105's py-fumen
Installation
python3 -m pip install py-fumen-py
Usage
from py_fumen_py import *
Module
bold namesare automatically imported withfrom py_fumen_py import *
| Name | Description | Importable Names |
|---|---|---|
action |
Codec for action in a fumen string | Action, ActionCodec |
comment |
Codec for comment in a fumen string | CommentCodec |
constant |
Constants used in the project | FieldConstants, FieldConstants110, FumenStringConstants |
field |
Playing field object | Field |
fumen_buffer |
Buffer objects for saved data | FumenBuffer, FumenBufferReader, FumenBufferWriter |
fumen_codec |
The Fumen codec | decode, encode |
js_escape |
escape() ported from JavaScript |
escape, unescape, escaped_compare |
operation |
Tetrimino placement object | Mino, Rotation, Operation |
page |
Page object | Flags, Refs, Page |
quiz |
Quiz object | Quiz |
Example
- Decoding
from py_fumen_py import *
pages = decode('v115@9gQ4EeAtBewhR4CeBtBewhg0Q4CeAtglRpwhi0Aeil?RpwhJeAgWSANxiSASowNE1oo2AzyBUAT5AAA')
for i, page in enumerate(pages):
print(i)
print(page.field)
- Encoding
from py_fumen_py import *
field = Field(
field='\n'.join([
'S_____Z__I',
'SS___ZZ__I',
'JS___ZLOOI',
'JJJ_LLLOOI',
]),
garbage='__________'
)
pages = [Page(
field=field,
operation=None,
comment='MKO you say?',
flags=Flags(),
refs=Refs())
]
print(encode(pages))
Difference Compared with tetris-fumen and py-fumen
- Action encoding and decoding are moved to
action - Comment encoding and decoding are moved to
comment - Added
FieldConstants110toconstantto accomodate for Fumen version110 decoderandencoderare combined into onefumen-codecmodulefieldandinner_fieldare combined into onefieldmodule- Action, comment and field reading/writing are moved to
fumen_buffer - Placement tetrimino
enumobjects are moved tooperation quizworks completely differently (based on this editor instead oftetris-fumen)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
py_fumen_py-0.0.8.tar.gz
(13.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_fumen_py-0.0.8.tar.gz.
File metadata
- Download URL: py_fumen_py-0.0.8.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41ecc3306115986ba8cfcf6861ccd782554baaea26b66b36dadae2dad38d6c07
|
|
| MD5 |
2659d7142b527c46b2a26659a99a7dc0
|
|
| BLAKE2b-256 |
2afcb83779ccc9d317326e4d38f4f30cc59ffe56afd7500824dcbf28e846bc52
|
File details
Details for the file py_fumen_py-0.0.8-py3-none-any.whl.
File metadata
- Download URL: py_fumen_py-0.0.8-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f6b0565660ca6b697e119cf9bf228dc5b2b3838213d6c84e49228d7ed8e4630
|
|
| MD5 |
6437d2ee554cfe60700675e4532a8f95
|
|
| BLAKE2b-256 |
1cfe2456ce65dbeaa2b9f41e9854cf9e2c695564439c2dfda4aeb2ae591ea28e
|