Happy new year (+ new demo)
Happy new year everyone! I still work on QED optimizations, although they take time to implement and the refactoring scope has increased. Hopefully, I’ll get some results in the coming weeks.
In the meantime, here is a small new demo. It is inspired by this elegant code that showcases TBC, a nice language that eases parallel programming with keywords. The QED code is very simple too, enough to insert it right here in its entirety.
int t = 0
void Circle(int i) {
int x = 250
while (QedYield())
x = 250 - 10 + 100 * cos(t / (512 + 4 * i))
<out: oval; size: 6; pos: [x, i * 3.75];>
}
Circle[] line = i::128 new Circle(i)
new QedInterval(16) -> {t += 16; qedResume(line);}
<size: [800, 480];>
<out: line;>
It shows a line made up of 128 circles and moves as a curve being more sinusoidal as time flies. Each circle is a sprite that swings horizontally. Here is the end result:
It is also available in the demos if you want to tinker with it!