GithubHelp home page GithubHelp logo

hatetris's People

Contributors

dependabot[bot] avatar qntm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hatetris's Issues

Redesigned AI API

I think that a safer way that you could rewrite the AI API is like this:

  • Append AI API function declarations to the beginning of inputted code
  • Convert modified code into JS data URI.
  • Start web worker from JS data URI.
  • Post a message to the web worker when it needs to calculate a move.
  • Make the web worker post a message to the host script to send the result.

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.

"Show a replay" button doesn't work with the new format (base65536)

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.

License

Can you please add an open source license for this code?

Pasting AI with // comments over-comments on Firefox (on Windows).

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

strip whitespace from base2048 string for replays

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:

Same-piece tetris

I was only getting the same piece over and over again. It sure spoils the game, but where's AI in that?

image

Improve piece selection by adding a loopup on which piece would leave most blank squares open

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

Implement mode with modern 7-piece-bag rule

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.