Just for fun. Conway’s in C++ seems to be an old favourite here, but I was curious about QML practicality and performance.
Here’s a primarily javascript implementation [bitbucket.org] using dynamic creation/destruction of cells (screenshot [bitbucket.org]). (Somewhere I have an older version using a Grid of Repeater stamped-out cells with alive/dead states and state transition animations… but it was hideously slow when I last tried it in Qt4.8/QDeclarative).
But what actually got me messing around with this stuff again was noticing the recursive option to ShaderEffectSource [qt-project.org] which opens up the possibility of computing updates with GLSL: implementation [bitbucket.org] (screenshot [bitbucket.org]).
Both run well (nice and fast) in Qt 5.3’s qmlscene (on Linux, with an old GeForce 9600 anway). Nothing interactive here; this was just to exercise the Javascript engine and for the GLSL to see if recursive updates worked as I hoped they would. They do, which opens the door to efficiently computing reaction-diffusion type effects [karlsims.com] on QtQuick UIs.
↧