22 Sep 2016 Pixel fun - messing with turtles

Just messing with “turtles” a little. The buttons activate different ones. Query values(in address bar) can set parameters. Some examples below the image. The turtles only interact via pixels.

If cnts is zero, it should be finished.(low cpu then)

cnts: - acts_cnt: - step_i: - N/A

stop previous</input>
Max concurrent

Examples that are variants with parameters set in the url.

Obviously it isn’t very polished. A more proper version would generate interfaces for parameters, allow arbitrary parameters each different turtle, be clearer about what does what, and not require refreshing.

The interface is pretty simple. You register named_patterns.yourname with a value {params:{..}, setup:function(params) ...}. And reg(newturtle, [n]) registers a turtle. newturtle.fun is the function(data,params), called once. To continue a turtle, re-register it. n allows registering further in the future.

k = i_of_xy(x,y) gets the index of a position, pix[k], pix[k+1], pix[k+2] are RGB values.

If you want to mess around, either just play with the browser, or Here is the source on github.

Update: added spiral_n_fun, further updates will be synced to this page.

Update (10-1-2017): due to changes this broke, should now be fixed.

Other Blog Posts