knewjade / tetris-fumen Goto Github PK
View Code? Open in Web Editor NEWA NPM package to Encode/Decode fumen for tetris
License: MIT License
A NPM package to Encode/Decode fumen for tetris
License: MIT License
data: https://harddrop.com/fumen/?v115@vhAVLn
Code:
const {decoder} = require("tetris-fumen");
const pages = decoder.decode("v115@vhAVLn");
console.log(pages[0].field.str());
pages[0].field.fill(pages[0].operation);
Result:
Error: Cannot fill piece on field
Is this intended? Quote from README:
Fill piece even if not on the ground, and return the mino as the placed
If floating pieces are not allowed, how does it differ from field.put
?
fumen codes with special characters do not load properly through direct link
example: v115@9gF8DeF8CeG8BeH8CeA8JeAgWEAa+VWC
the fumen link is able to load the fumen from its url code but the pc solver link is not
this is because special characters in the fumen code are raw and get parsed differently than intended
I'd like to draw the current operation with a lightened color. I need the position after the piece is filled in the field. Example:
const pages = decoder.decode(data);
const field = pages[0].field.copy();
const changedTiles = field.fill(pages[0].operation);
for (let y = 0; y < 20; y++) {
for (let x = 0; x < 10; x++) {
myCanvas.draw(x, y, field.at(x, y));
}
}
for (const [x, y] of changedTiles) {
myCanvas.lighten(x, y);
}
Maybe we can also add this feature to field.put
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.