Who wants to help by running a program that can generate Conway's Game of Life?

I wrote a script to post random pixels, but a much more artistic form of expression might be to render Conway's Game of Life cellular automata on r/place. From there, a next step might be to actually render video.

Would anyone be interested in joining me?

As a demonstration, here's a quick script you can run in your browser to push randomized pixels:

var contribute = function() {
  var rand = function(n) { return Math.floor(Math.random() * n); },
      x = 100,
      y = 100,                                                                                                                                                              
      c = rand(15);
  $.ajax({
    type: 'POST',
    url: '/api/place/draw.json',
    data: {
      'x': x,
      'y': y,
      'color': c,
    },
    beforeSend: function(request) {
      var token = $("input[name=uh]").val();
      request.setRequestHeader('x-modhash', token);
    },
  })
  .done(function(data) {
    console.log('Painted color ' + c + ' at coordinate ' + x + 'x' + y + '.');
    console.log('Waiting ' + data.wait_seconds + ' seconds');
    setTimeout(function() { contribute() }, data.wait_seconds * 1000);
  })
  .fail(function(xhr) {
    var wait = xhr.responseJSON.wait_seconds;
    console.log('Attempted too soon. Waiting ' + wait + ' seconds.');
    setTimeout(function() { contribute() }, wait * 1000);
  });
};

contribute();

Chrome Instructions:

  1. Make sure you're browsing Reddit and logged in.
  2. On a Reddit tab, right click -> Inspect
  3. Click the "Console" tab on the web inspector that pops up.
  4. Paste the script in its entirety.
  5. Leave it running as long as you don't navigate away (on that tab)
  6. Alternatively hard coding values could reinforce a pattern.

Posted Apr 3, 2017, 6:30 AM UTC

10

No comments yet

Nobody commented on this post, or the comments weren't captured.