ttencate / tis

An embeddable Tetris clone without dependencies in 4 kB of JavaScript
http://ttencate.github.io/tis
BSD 3-Clause "New" or "Revised" License
139 stars 16 forks source link

Minify index.html and tis.min.js #5

Open nineteendo opened 10 months ago

nineteendo commented 10 months ago

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

Tutorial:

ttencate commented 10 months ago

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).

nineteendo commented 10 months ago

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
nineteendo commented 10 months ago

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

ttencate commented 10 months ago

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.

nineteendo commented 10 months ago

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.