ttencate / tis

An embeddable Tetris clone without dependencies in 4 kB of JavaScript

Home Page:http://ttencate.github.io/tis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Minify index.html and tis.min.js

nineteendo opened this issue · comments

I got your code down to 4016 bytes (and html to 1024 bytes): tis-master.zip

Tutorial:

  • index.html:
    • remove <!DOCTYPE html>
    • kangax (default)
    • replace http:// with https://
    • replace tis.js with tis.min.js
    • replace en.wikipedia.org with wikipedia.org
    • first javascript:
      • replace function(t,e,s) with function(t)
    • second javascript:
  • tis.min.js:

Apparently minifiers have improved over the past 10 years :)

Fwiw, the 4 kiB limit only applies to tis.min.js (which is self-sufficient), not the HTML (which can be any page).

Fwiw, the 4 kiB limit only applies to tis.min.js (which is self-sufficient), not the HTML (which can be any page).

I'm comparing the smallest versions of Tetris. And I'm also counting the total size. (Main size is how the program is advertised).

Screenshot 2024-01-06 at 18 44 07

Would a pull request be easier? If you want I can keep the unminified html as a separate file, but with https, the minified javascript and wikipedia.org: index-source.html.zip

No need, thanks. I wrote this 10 years ago for fun, and I'm not maintaining it anymore.

Your spreadsheet is very cool! At 4 kiB, Tis is actually one of the bigger ones, but then again it's also pretty rich in features.

Your program definitely has a lot of features, 26 (or 30 if you count features of the browser):
smallest-tetris-programs
My main problem is that the language I've written it in is compact, but extremely slow. Which makes most of the remaining features not possible, except for "bags-of-seven", which sounds fun to implement for the 1.5 KB version.