JS1k 2016
February - March 2016
JS1k is certainly code-golfing event that makes me wait for February to come, during all the rest of the year.
This year, the theme was EleMental, and I decided to make two chemistry-related demos with the help of my friends Innovati and Subzey (a.k.a. The Codegolf Team), plus a couple of entries by myself.
If you're curious about how they were made or how they can fit in 1kb, take a look at the detailed source code. It's very detailed.
If you want to support us for the "social prize", you can upvote the demos on reddit!
PERIOD1k
Our first challenge was to draw a pretty periodic table of chemical elements with as much information as possible. After long efforts of data compression dead-ends and successes, we released PERIOD1k. It was the first entry of the compo.
- The entry on js1k (1024b)
- The post on reddit
- The project (with bonuses) on Github
- The detailed source code
JSOTOPES
We then gave ourselves another compression challenge: draw a complete table of isotopes (or table of nuclides). This time, there was so much data to include th the app that the JS code used to draw the chart only takes ~10% of the demo, all the rest is used for the position, number and decay types of all the known isotopes.
- The entry on js1k (1023b)
- The post on reddit
- The project (with bonuses) on Github
- The detailed source code
PS: In February, researchers discovered the tetraneutron particle. I didn't manage to include it in our demo in less than 1025b. ARRGGH.
UN1kODE
For my first individual entry, I wanted to revisit a Unicode slideshow that I made a few months earlier, called MiniUnicode. It's actually a collection of slideshows made to fit in 64b, 128b, 256b, 512b, 4kb, 512kb, including more and more details at each version. The 512b version only shows the assigned code points, but the 4kb version includes all the Unicode blocks names. I decided to do something in the middle: a demo that shows all the assigned code points, but is also aware of all the blocks sizes, and able to start the animation from any of these blocks. That required a lot of compression and transformation of the original code, but it worked!
- The entry on js1k (1024b)
- The post on reddit
- The project on Github
- The detailed source code
MiniBeautifier
This final challenge came as a surprise, while I was developping my code-golfing IDE. Subzey suggested that I add a code beautifier to see the "unminified" version of our code in real time, so I decided to develop one from scratch. Subzey also told me it was impossible to achieve this task using RegExes, so I took it as a personal challenge, and succeeded. Then I golfed my code a little and realized it could fit in 1kb with some extra compression. And that's what I did.
- The entry on js1k (1022b)
- The post on reddit
- The project on Github
- The detailed source code
Bonus: emulation!
There are some other 1kb projects that I started to prepare before February, but they weren't good enough (or small enough) to be submitted. Here they are in exclusivity, just for you:
Here's a Chip8 ROM decompiler (1024b gzipped)
And a Chip8 emulator with sound, packed in a js1k shim (~1040b regpacked, but still buggy)
(Both are inspired by my old Chip8 emulator project, where I had made a PNG-bootstrapped Chip8 emulator, without sound, in 1028b).
Bonus 2: Compilations!
I also prepared two compilations including all the tiny apps and games that I golfed with the team
(@p01, @subzey, @aemkei, @0ndras, @maettig and @ilesinge) during the past year.
Sadly, none of them fits in 1kb but you can try them here!
4 Games (1230b)
(Featuring MiniGameOfBraille, MiniFlappyBraille, Ping & Pacman)

7 Apps (1157b)
(Featuring MiniMandelbrot, MiniMandelbrot ASCII, MiniBookmarklet, Countdown 2017, Xmas trees, MiniKeyCode & MiniUnicode)

Cheers,
xem