Hacker News new | past | comments | ask | show | jobs | submit login
Minimal 16x16 Dots Coding Environment (tixy.land)
186 points by franze on Nov 2, 2020 | hide | past | favorite | 37 comments



I can haz teh haxx0rz? Working around the character limit.

I stored an expression in the URL fragment/hash, loaded it from there and eval-ed it. The hash symbol would break the expression, so it needs to be removed or commented out. Removing it by string manipulation would have exceeded the 32 character limit, so I went with commenting it out. That means you need to start any expression with "* /" (remove the space) to close the comment around the hash symbol.

The hover text of the example link gives you a good idea of what is happening.

Have fun!

Random animation, 47 characters payload:

https://tixy.land/?code=eval(%27%2F*%27%2Bparent.location.ha...



This is so much fun!

Not as good as some here, but here is an animated sinus function: https://tixy.land/?code=y%3D%3D%7E%7E%288-7*Math.sin%28t*5%2...

Tip: Writing ~~ is much more space efficient than Math.floor


|0 is also a nice alternative to floor.




That clz32 is fun - https://tixy.land/?code=sin%28clz32%28y*x%3C%3C%285*t%29%29%...

(looks like it auto-adds `Math.` for you now)


Here is my best effort, a sort of breathing Sierpinski triangle

https://tixy.land/?code=i%26x%26%28y*Math.sin%28t%29%29

You can have lots of fun mixing the bitwise ops with trig functions!


I discovered only now that the snippet is evaluated with(Math){ }. Therefore you can omit Math. on calls to methods of it and have five more extra characters at your disposal. Strange that they did not mention this in the tutorial. It seems rather important as the budget is super-limited.


Sigh, it is actually there. My mistake.

// skip `Math.` to use methods

// and props like `sin` or `PI`


Reminds me of writing full-screen fragment shaders, where you'd just get a screen position and time and construct some cool things. This one's much smaller and easier to reason about though, very cool :)



This is really sweet, I love stuff like this. I do have a suggestion though, which is to create some aliases for the most commonly used Standard Library functions, such as Math.sin into s, or Math.cos into c, etc. This would save some space and allow slightly more code to be entered and more complex effects to be achieved.


Reminds me of the minimalist 24a2 game engine [0] that was shared here a while back [1].

[0] https://24a2.routley.io/

[1] https://news.ycombinator.com/item?id=23664814






These are great!


I have one without animation but with more colors: http://www.benibela.de/web-apps_en.html?&cmgenerate=true&cmf...



This is awesome. The page does a wonderful job at explaining what this is and how it works.

Trying to guess what a function will look like without looking at the dots is fun.


It's like a mini Dwitter (which is 140 characters)

https://www.dwitter.net


This is so great!

Would you know of any resources to build a little led circuit like that on a breadborad, with standard components, that could be powered by a Pi?

In smaller dimensions of course, but even 4*4 would be interesting for educational purposes. The things I found online all used pre-built led boards which is less interesting I think.


A MAX7219 is an LED driver that can power an 8x8 grid of LEDs, so you could do the full 16x16 with 4 of these, or shrink down to 8x8 with just one. Then it's just a case of wiring up the LED matrix and connecting the MAX7219 to the Pi.



Wow this was amazing! If anyone could enlighten me - is there some general theory behind generate these patterns?

I am flummoxed by all these code examples - they produce so much with so little. Any theory behind these cryptic sin and cos 1 liners?


If you click on the animation then it will walk you through how it works. Keep clicking, each click gives you another hint.


How is the syntax here working? Is that an assignment operator?


You write the body of the function that takes t, i, x, and y as inputs for each dot. A return value of 1 or "1" or true and it shows a large white dot. A return value of 0 or false, and it shows nothing. A return value of -1 or "-1" and it shows a large red dot. Positive fractions is a smaller white dot, negative fractions is a smaller red dot.

https://tixy.land/?code=i%2F256

https://tixy.land/?code=x%21%3D5+%26%26+y+%21%3D+7

https://tixy.land/?code=x%2F32%2By%2F32

https://tixy.land/?code=Math.sin%28t%29

https://tixy.land/?code=Math.sin%28t%2Bx%29

https://tixy.land/?code=Math.sin%28t%2By%29

https://tixy.land/?code=Math.sin%28t%2Bi%29



Input limited to 32 chars. Wanted to make a Game of Life.


This is awesome and could be a nice educational tool. Although I just want to extend it to allow simple games :)


still trying to get the whole thing, but I have this so far: https://tixy.land/?code=y-%3D6%2Bsin%28t%29*x**2%2F99%2C%28y...



Winamp MilkDrop light :))


That's brillant!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: