qntm / hatetris Goto Github PK
View Code? Open in Web Editor NEWTetris which always gives you the worst piece
License: MIT License
Tetris which always gives you the worst piece
License: MIT License
Its funny the hard derivant from the original tetris, i wonder if the keybindings are missing or not?
I think that a safer way that you could rewrite the AI API is like this:
The reason you can't just use a URL to some script that evals the AI code is that web workers can still run fetch requests, so you don't want to eval code on the main HATETRIS domain.
Hi I am a researcher, but I am not familiar with javascript.
If you don't mind, I hope I can get the pseudocode or python code of the algorithm.
This can help me understand the algorithm.
Love this game!
I tried to watch the world record replay as listed in the base65536 repository, but it wouldn't work. When I tried the hex version, it did. Since it doesn't even output the hex format anymore, this is obviously a problem, as the replays it gives you don't work at all. I think it should accept (and output, why not) both formats.
Can you please add an open source license for this code?
If you have night light on (blue light filter), then the blue pieces become completely invisible.
Copy-pasting AI code with // comments, like the example code, into the prompt box works on Chrome, but on Firefox gives the error:
Error
expected expression, got '}'
Caught this exception while trying to evaluate your custom AI JavaScript.
After fiddling with it for a bit, I'm pretty sure this is because Chrome preserves newline characters in prompt input but Firefox doesn't, so everything after the // is just commented out, resulting in an empty program.
Suggestions:
Better error message for effectively empty program
Using a textarea to solicit AI programs, or making a note of this bug somewhere.
I've also filed this bug report against firefox and the mdn compatibility documentation, so we'll see what they say: https://bugzilla.mozilla.org/show_bug.cgi?id=1716229 mdn/browser-compat-data#10994
I've recently come across two papers that might be relevant to this project and/or https://github.com/qntm/tetris
The first purports to show an algorithm in which the machine can force you to lose a game of tetris:
Can you win at TETRIS? Brzustowski, John 1992
The second purports to show that a series of SZSZSZ... is enough, though it seems to be slower:
How to lose at Tetris. Burgiel, Heidi 1997
Just tried to copy a base2048 string into the replay box from an email, and since it had some initial space characters it silently failed. The web console logged Uncaught Error: Unrecognised Base2048 character:
This would make the game easier, just like the 7bag rule, but I think it'd be interesting for people looking into how hard could the modern tetris rules work. Would you like that?
Right now, is quite easy to get into loops once you set up a specific pattern in the lowest row of the board. Loops with Os and Is are easy to fill plus leave a lot lf playroom to get set up other patterns. This makes getting tons of lines """"""""""""""""trivial"""""""""""""""""" and could risk an algorithm existing that maintains the tower in place. At the very least, I think we can do better to ensure the first line is much harder to get, or outright impossible
My idea would be to have a sort of look up to see which piece would leave more "blank squares" up. As to avoid lines AND filling the board easily.
This is not easy to do at all, but I think it'd be interesting to try. What are your opinions? I'd love to work in this too.
Think that is a sufficient condition to leave one square blank in a line for a line to not ever be possible in that place. I think it could be very interesting to play with that a little
I would like to work in a variation that shows the modern 7 piece bag rule. Is a simple change, but it would be interesting to people to see what happens in a modern tetris setting
Would that be ok? Or would you prefer to leave it as is and go with a fork?
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.