Archive for the ‘flash experiments’ Category

Halloween post: ascii “Backrooms”

October 30th, 2026

The scene is ray casted ascii backrooms gltf model, software-rendered, WASM SIMD-accelerated.
Arrows or mobile touch – walking. WSAD to strafe and look up/down
Arrows – looking. More rooms to explore on teleranek.org

Posted in flash experiments | Comments (0)

“Char hunt”

October 28th, 2026

Version of popular food hunt, but with chars!
Following are 2 examples, more on teleranek.org:

The “Stupid mode” button toggles between ants just going straight for the food, passing through themselves, and ants having a mind of their own and trying to pass each other, like people in crowded space. Second mode though requires some patience, as it isn’t so easy for the ants to pass each other in the narrow corridors.

Posted in flash experiments | Comments (0)

New landing

September 17th, 2026
teleranek.org

First thing added here was DOOM (click “DOOM”, long press – choose menu item):

Don’t miss space invaders underneath among other things, like “Slop”


When done gaming, do some work in DOS (or Linux, it is somewhere to the right), and eat something as a snake (click “SNAKE”):


Or draw some art (start drawing):


Watch some cat videos or quake movie:


At the end, hit “screw that” and go away:

This landing site is bio meat-made and uses MIT NON-AI License, so screw away if you are aritficial, go steal some books

Posted in flash experiments | Comments (0)

Update of sketch/drawing recognition

October 23rd, 2017

I’ve udpated my sketch recognition algorithm, so it doesn’t load 30 minutes in the browser and is actually usable. First load for slow connections is a bit longer though.
The update was possible by usage of browser’s Indexed Database and some other stuff. I should’ve thought about it 4 years ago… Now this app looks outdated. Even some big corporations managed to make their own recognition web apps during that time -_-

PROBABLY DOESN’T WORK IN FIREFOX – it is because this app is super-old and I’d have to update CSS stuff. Don’t have time for this.

http://teleranek.org/sketchenhancer

Posted in flash experiments | Comments (0)

How to get the week number in a month

April 9th, 2015

Recently I wanted to display a number of week in a month. At first I wanted to get the formula from google instead of thinking, but there was no such formula. Also, I’ve found a lengthy discussion and only some indian guy gave the formula (which was incorrect of course:D)

Suppose that November the 1st is Thursday. Then for example, November 2nd is a 1st week of November, November 16th is a 3rd week, 30th is 5th week (basing on a fact that Monday starts the week)
Here’s the table that illustrates it:

?How to get the week number?

~~( ( m - w + 6 ) / 7 )

where m is an integer, a month day, 0 or 1-based
w is an integer, a week day, 0 or 1-based (e.g. Monday = 1, Thursday = 4)

Double bitwise negation is just a conversion to integer, you can use floor if you don’t care about speed (I guess that’s the case in times of virtual machine driven emulators and regex-based [greets angular;) ] js frameworks).

I’ll rebelliously leave it without a proof.

Posted in flash experiments | Comments (0)

Flower fractals super squished edition

March 9th, 2015

Recently I stumbled upon a challenge on challengepost.com – “20 lines of JavaScript”. The goal was to write a 20 line JS code that does something that can make the challenge judges vote for you. I thought the best idea would be to treat this challenge like a good ol’ demoscene compo. I’ve already had a good effect – the flower fractals. Unfortunately, after porting it to JavaScript it was 11 KBytes :( and 383 lines of code, not always shorter than the required 80 chars (or maybe even more, but I don’t remember where I put the first version). I used PIXI, great 2D javascript library because it uses several enhancements for JS canvas (it also supports WebGL, but WebGL isn’t really a vector-like drawing thing, the lines are aliased and poor quality, to obtain better quality I’d need to use textures and stuff, I thought it would be too complicated for 20 lines of code).

OK, so I’ve got 383 lines and 11 kilobytes. As we all know, 20 lines of 80 char code is 1600 bytes, so there’s way to go… I checked with google closure compiler, how I could squish that – after compressing, it was about 5 kilos. Still too much. After hours of merging functions, deleting smooth line bezier-based rendering, reusing some vars, it went down to about 3 kilos.

I started to think that its impossible to do, unless some miracle happens.

Then I stumbled upon this great method of utilising somehow buggy behaviour of browsers – treating PNG files like HTML, when compressed PNG data resembles HTML data. After changing the JS to one big eval(…) function and compressing it to PNG I went down to 1600 bytes. Well, exactly 1595. Changing some things inside eval and making the code larger allowed PNG to compress it enough. So there’s this curiosity – PNG JavaScript: 1600BYTES

This was of course no-go, because it wasn’t really javascript – it was png, and I it would be really really hard to intoduce line breaks inside zipped binary data. Also, it’s very ugly, you can see some errors appearing when running this code – some PNG IHDR data is displayed for a short period of time. I had to come up with something else. But how to squish the code better than the zip algorithm itself?

Then I had a moment of enlightning – it’s 20 lines of 80 characters challenge, not 1600 bytes challenge. How about UTF-16? I could write 2 bytes inside 1 UTF16 character.

It worked! Excited, I searched on google if anyone else did it – of course someone already came up with that idea ;/ And the idea was better because the decoder is like:
eval(unescape(escape('SOME STRING').replace(/uD./g,'')))

And mine was much longer and 2 lines:
function(s){A=[];for(i=0;i<s.length;i++){c=s.charCodeAt(i);A.push(c&255);
c>>8?A.push(c>>8):c;}return String.fromCharCode.apply(String,A)}("SOME STRING");

But my method used a bit different technique, so I could use normal letters and fit some ASCII art inside the code, not only some strange chinese letters.

OK, so after compiling with google closure, making big eval and changing to UTF-16, the code looks like this:

Zrzut ekranu 2015-03-09 02.21.38

And can be seen on the challengepost’s winners’ ( ?° ?? ?°)  gallery:
http://challengepost.com/software/20-lines-of-green

or here
or JSFiddle: http://jsfiddle.net/to267224/tbgad7uz/

ps. I will enhance this post later maybe, to provide some missing info on technical things and add some images, cause there’s too much unformatted text ; )

Tags: , , , ,
Posted in flash experiments | Comments (0)