<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Game of Life</title>
  </head>
  <body>
  <canvas id="canvas"></canvas>
  <div id="widthLabel"></div>
  <div id="heightLabel"></div>
  <div id="fpsCounter"></div>
  <div id="controls">
    <label for="radioWebAssembly">WebAssembly</label>
    <input id="radioWebAssembly" name="controls" type="radio" checked="checked">
    <label for="radioJS">JS</label>
    <input id="radioJS" name="controls" type="radio">
  </div>
  <script type="text/javascript" src="bundle.js"></script>
  </body>
</html>
 html, body {
  width:  100%;
  height: 100%;
  margin: 0;
  text-align: center;
}

#widthLabel, #heightLabel, #fpsCounter, #controls {
  background: white;
  position: absolute;
  user-select: none;
}

#fpsCounter {
  top: 0;
  right: 0;
}

#controls {
  display: flex;
  top: 18px;
  right: 0;
}

#widthLabel {
  top: 0;
  left: 0
}

#heightLabel {
  top: 18px;
  left: 0;
}
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){var n=new ArrayBuffer(5051);new Uint8Array(n).set([0,97,115,109,1,0,0,0,1,41,8,96,2,127,127,1,127,96,0,0,96,4,127,127,127,127,0,96,2,127,127,0,96,1,127,1,127,96,3,127,127,127,0,96,1,127,0,96,0,1,124,2,76,5,3,101,110,118,5,97,98,111,114,116,0,2,4,77,97,116,104,6,114,97,110,100,111,109,0,7,7,105,109,112,111,114,116,115,5,119,105,100,116,104,3,127,0,7,105,109,112,111,114,116,115,6,104,101,105,103,104,116,3,127,0,3,101,110,118,6,109,101,109,111,114,121,2,0,1,3,35,34,3,3,5,1,4,0,3,5,0,0,6,4,3,4,5,6,1,6,6,6,6,6,6,6,1,1,1,1,0,3,1,3,3,1,6,37,7,127,1,65,0,11,127,1,65,0,11,127,1,65,0,11,127,1,65,0,11,127,1,65,0,11,127,1,65,0,11,127,0,65,128,2,11,7,96,9,6,109,101,109,111,114,121,2,0,7,95,95,97,108,108,111,99,0,11,8,95,95,114,101,116,97,105,110,0,13,9,95,95,114,101,108,101,97,115,101,0,21,9,95,95,99,111,108,108,101,99,116,0,26,11,95,95,114,116,116,105,95,98,97,115,101,3,8,9,114,97,110,100,111,109,105,122,101,0,28,4,115,116,101,112,0,29,5,112,97,105,110,116,0,31,8,1,32,10,228,34,34,160,2,1,4,127,32,1,40,2,0,34,3,65,1,113,69,4,64,65,0,65,24,65,149,2,65,13,16,0,0,11,32,3,65,124,113,34,2,65,16,79,4,127,32,2,65,240,255,255,255,3,73,5,65,0,11,69,4,64,65,0,65,24,65,151,2,65,13,16,0,0,11,32,2,65,128,2,73,4,127,32,2,65,4,118,33,2,65,0,5,32,2,65,31,32,2,103,107,34,3,65,4,107,118,65,16,115,33,2,32,3,65,7,107,11,34,3,65,23,73,4,127,32,2,65,16,73,5,65,0,11,69,4,64,65,0,65,24,65,164,2,65,13,16,0,0,11,32,1,40,2,20,33,4,32,1,40,2,16,34,5,4,64,32,5,32,4,54,2,20,11,32,4,4,64,32,4,32,5,54,2,16,11,32,3,65,4,116,32,2,106,65,2,116,32,0,106,40,2,96,32,1,70,4,64,32,3,65,4,116,32,2,106,65,2,116,32,0,106,32,4,54,2,96,32,4,69,4,64,32,3,65,2,116,32,0,106,32,3,65,2,116,32,0,106,40,2,4,65,1,32,2,116,65,127,115,113,34,1,54,2,4,32,1,69,4,64,32,0,32,0,40,2,0,65,1,32,3,116,65,127,115,113,54,2,0,11,11,11,11,253,3,1,6,127,32,1,69,4,64,65,0,65,24,65,205,1,65,13,16,0,0,11,32,1,40,2,0,34,3,65,1,113,69,4,64,65,0,65,24,65,207,1,65,13,16,0,0,11,32,1,65,16,106,32,1,40,2,0,65,124,113,106,34,4,40,2,0,34,5,65,1,113,4,64,32,3,65,124,113,65,16,106,32,5,65,124,113,106,34,2,65,240,255,255,255,3,73,4,64,32,0,32,4,16,2,32,1,32,3,65,3,113,32,2,114,34,3,54,2,0,32,1,65,16,106,32,1,40,2,0,65,124,113,106,34,4,40,2,0,33,5,11,11,32,3,65,2,113,4,64,32,1,65,4,107,40,2,0,34,2,40,2,0,34,6,65,1,113,69,4,64,65,0,65,24,65,228,1,65,15,16,0,0,11,32,6,65,124,113,65,16,106,32,3,65,124,113,106,34,7,65,240,255,255,255,3,73,4,127,32,0,32,2,16,2,32,2,32,6,65,3,113,32,7,114,34,3,54,2,0,32,2,5,32,1,11,33,1,11,32,4,32,5,65,2,114,54,2,0,32,3,65,124,113,34,2,65,16,79,4,127,32,2,65,240,255,255,255,3,73,5,65,0,11,69,4,64,65,0,65,24,65,243,1,65,13,16,0,0,11,32,4,32,1,65,16,106,32,2,106,71,4,64,65,0,65,24,65,244,1,65,13,16,0,0,11,32,4,65,4,107,32,1,54,2,0,32,2,65,128,2,73,4,127,32,2,65,4,118,33,4,65,0,5,32,2,65,31,32,2,103,107,34,2,65,4,107,118,65,16,115,33,4,32,2,65,7,107,11,34,3,65,23,73,4,127,32,4,65,16,73,5,65,0,11,69,4,64,65,0,65,24,65,132,2,65,13,16,0,0,11,32,3,65,4,116,32,4,106,65,2,116,32,0,106,40,2,96,33,2,32,1,65,0,54,2,16,32,1,32,2,54,2,20,32,2,4,64,32,2,32,1,54,2,16,11,32,3,65,4,116,32,4,106,65,2,116,32,0,106,32,1,54,2,96,32,0,32,0,40,2,0,65,1,32,3,116,114,54,2,0,32,3,65,2,116,32,0,106,32,3,65,2,116,32,0,106,40,2,4,65,1,32,4,116,114,54,2,4,11,203,1,1,2,127,32,2,65,15,113,69,65,0,32,1,65,15,113,69,65,0,32,1,32,2,77,27,27,69,4,64,65,0,65,24,65,130,3,65,4,16,0,0,11,32,0,40,2,160,12,34,3,4,64,32,1,32,3,65,16,106,73,4,64,65,0,65,24,65,140,3,65,15,16,0,0,11,32,1,65,16,107,32,3,70,4,64,32,3,40,2,0,33,4,32,1,65,16,107,33,1,11,5,32,1,32,0,65,164,12,106,73,4,64,65,0,65,24,65,152,3,65,4,16,0,0,11,11,32,2,32,1,107,34,2,65,48,73,4,64,15,11,32,1,32,4,65,2,113,32,2,65,32,107,65,1,114,114,54,2,0,32,1,65,0,54,2,16,32,1,65,0,54,2,20,32,1,32,2,106,65,16,107,34,2,65,2,54,2,0,32,0,32,2,54,2,160,12,32,0,32,1,16,3,11,151,1,1,2,127,65,1,63,0,34,0,74,4,127,65,1,32,0,107,64,0,65,0,72,5,65,0,11,4,64,0,11,65,160,2,65,0,54,2,0,65,192,14,65,0,54,2,0,65,0,33,0,3,64,2,64,32,0,65,23,79,13,0,32,0,65,2,116,65,160,2,106,65,0,54,2,4,65,0,33,1,3,64,2,64,32,1,65,16,79,13,0,32,0,65,4,116,32,1,106,65,2,116,65,160,2,106,65,0,54,2,96,32,1,65,1,106,33,1,12,1,11,11,32,0,65,1,106,33,0,12,1,11,11,65,160,2,65,208,14,63,0,65,16,116,16,4,65,160,2,36,2,11,45,0,32,0,65,240,255,255,255,3,79,4,64,65,200,0,65,24,65,201,3,65,29,16,0,0,11,32,0,65,15,106,65,112,113,34,0,65,16,32,0,65,16,75,27,11,221,1,1,1,127,32,1,65,128,2,73,4,127,32,1,65,4,118,33,1,65,0,5,32,1,65,248,255,255,255,1,73,4,64,65,1,65,27,32,1,103,107,116,32,1,106,65,1,107,33,1,11,32,1,65,31,32,1,103,107,34,2,65,4,107,118,65,16,115,33,1,32,2,65,7,107,11,34,2,65,23,73,4,127,32,1,65,16,73,5,65,0,11,69,4,64,65,0,65,24,65,210,2,65,13,16,0,0,11,32,2,65,2,116,32,0,106,40,2,4,65,127,32,1,116,113,34,1,4,127,32,1,104,32,2,65,4,116,106,65,2,116,32,0,106,40,2,96,5,32,0,40,2,0,65,127,32,2,65,1,106,116,113,34,1,4,127,32,1,104,34,1,65,2,116,32,0,106,40,2,4,34,2,69,4,64,65,0,65,24,65,223,2,65,17,16,0,0,11,32,2,104,32,1,65,4,116,106,65,2,116,32,0,106,40,2,96,5,65,0,11,11,11,108,1,1,127,63,0,34,2,65,16,32,0,40,2,160,12,32,2,65,16,116,65,16,107,71,116,65,1,65,27,32,1,103,107,116,65,1,107,32,1,106,32,1,32,1,65,248,255,255,255,1,73,27,106,65,255,255,3,106,65,128,128,124,113,65,16,118,34,1,32,2,32,1,74,27,64,0,65,0,72,4,64,32,1,64,0,65,0,72,4,64,0,11,11,32,0,32,2,65,16,116,63,0,65,16,116,16,4,11,135,1,1,2,127,32,1,40,2,0,33,3,32,2,65,15,113,4,64,65,0,65,24,65,237,2,65,13,16,0,0,11,32,3,65,124,113,32,2,107,34,4,65,32,79,4,64,32,1,32,3,65,2,113,32,2,114,54,2,0,32,1,65,16,106,32,2,106,34,1,32,4,65,16,107,65,1,114,54,2,0,32,0,32,1,16,3,5,32,1,32,3,65,126,113,54,2,0,32,1,65,16,106,32,1,40,2,0,65,124,113,106,32,1,65,16,106,32,1,40,2,0,65,124,113,106,40,2,0,65,125,113,54,2,0,11,11,106,1,2,127,32,0,32,1,16,6,34,3,16,7,34,2,69,4,64,32,0,32,3,16,8,32,0,32,3,16,7,34,2,69,4,64,65,0,65,24,65,231,3,65,15,16,0,0,11,11,32,2,40,2,0,65,124,113,32,3,73,4,64,65,0,65,24,65,233,3,65,13,16,0,0,11,32,2,65,0,54,2,4,32,2,32,1,54,2,12,32,0,32,2,16,2,32,0,32,2,32,3,16,9,32,2,11,34,1,1,127,35,2,34,2,4,127,32,2,5,16,5,35,2,11,32,0,16,10,34,0,32,1,54,2,8,32,0,65,16,106,11,81,1,1,127,32,0,40,2,4,34,1,65,128,128,128,128,127,113,32,1,65,1,106,65,128,128,128,128,127,113,71,4,64,65,0,65,128,1,65,232,0,65,2,16,0,0,11,32,0,32,1,65,1,106,54,2,4,32,0,40,2,0,65,1,113,4,64,65,0,65,128,1,65,235,0,65,13,16,0,0,11,11,20,0,32,0,65,156,2,75,4,64,32,0,65,16,107,16,12,11,32,0,11,45,1,1,127,32,1,40,2,0,34,2,65,1,113,4,64,65,0,65,24,65,162,4,65,2,16,0,0,11,32,1,32,2,65,1,114,54,2,0,32,0,32,1,16,3,11,39,0,32,0,65,128,2,40,2,0,75,4,64,65,176,1,65,232,1,65,22,65,27,16,0,0,11,32,0,65,3,116,65,132,2,106,40,2,0,11,178,2,1,2,127,2,64,32,2,33,3,32,0,32,1,70,13,0,32,0,32,1,73,4,64,32,1,65,7,113,32,0,65,7,113,70,4,64,3,64,32,0,65,7,113,4,64,32,3,69,13,4,32,3,65,1,107,33,3,32,0,34,2,65,1,106,33,0,32,1,34,4,65,1,106,33,1,32,2,32,4,45,0,0,58,0,0,12,1,11,11,3,64,32,3,65,8,73,69,4,64,32,0,32,1,41,3,0,55,3,0,32,3,65,8,107,33,3,32,0,65,8,106,33,0,32,1,65,8,106,33,1,12,1,11,11,11,3,64,32,3,4,64,32,0,34,2,65,1,106,33,0,32,1,34,4,65,1,106,33,1,32,2,32,4,45,0,0,58,0,0,32,3,65,1,107,33,3,12,1,11,11,5,32,1,65,7,113,32,0,65,7,113,70,4,64,3,64,32,0,32,3,106,65,7,113,4,64,32,3,69,13,4,32,0,32,3,65,1,107,34,3,106,32,1,32,3,106,45,0,0,58,0,0,12,1,11,11,3,64,32,3,65,8,73,69,4,64,32,0,32,3,65,8,107,34,3,106,32,1,32,3,106,41,3,0,55,3,0,12,1,11,11,11,3,64,32,3,4,64,32,0,32,3,65,1,107,34,3,106,32,1,32,3,106,45,0,0,58,0,0,12,1,11,11,11,11,11,56,0,35,2,69,4,64,65,0,65,24,65,192,4,65,13,16,0,0,11,32,0,65,15,113,69,65,0,32,0,27,69,4,64,65,0,65,24,65,193,4,65,2,16,0,0,11,35,2,32,0,65,16,107,16,14,11,69,1,4,127,35,3,35,5,34,1,107,34,2,65,1,116,34,0,65,128,2,32,0,65,128,2,75,27,34,3,65,0,16,11,34,0,32,1,32,2,16,16,32,1,4,64,32,1,16,17,11,32,0,36,5,32,0,32,2,106,36,3,32,0,32,3,106,36,4,11,34,1,1,127,35,3,34,1,35,4,79,4,64,16,18,35,3,33,1,11,32,1,32,0,54,2,0,32,1,65,4,106,36,3,11,181,1,1,2,127,32,0,40,2,4,34,2,65,255,255,255,255,0,113,33,1,32,0,40,2,0,65,1,113,4,64,65,0,65,128,1,65,243,0,65,13,16,0,0,11,32,1,65,1,70,4,64,32,0,65,16,106,65,1,16,34,32,2,65,128,128,128,128,120,113,4,64,32,0,65,128,128,128,128,120,54,2,4,5,35,2,32,0,16,14,11,5,32,1,65,0,77,4,64,65,0,65,128,1,65,252,0,65,15,16,0,0,11,32,0,40,2,8,16,15,65,16,113,4,64,32,0,32,1,65,1,107,32,2,65,128,128,128,128,127,113,114,54,2,4,5,32,0,32,1,65,1,107,65,128,128,128,128,123,114,54,2,4,32,2,65,128,128,128,128,120,113,69,4,64,32,0,16,19,11,11,11,11,18,0,32,0,65,156,2,75,4,64,32,0,65,16,107,16,20,11,11,58,1,1,127,32,0,40,2,4,34,1,65,128,128,128,128,7,113,65,128,128,128,128,1,71,4,64,32,0,32,1,65,255,255,255,255,120,113,65,128,128,128,128,1,114,54,2,4,32,0,65,16,106,65,2,16,34,11,11,28,0,32,0,32,0,40,2,4,65,255,255,255,255,120,113,54,2,4,32,0,65,16,106,65,4,16,34,11,78,1,1,127,32,0,40,2,4,34,1,65,128,128,128,128,7,113,65,128,128,128,128,1,70,4,64,32,1,65,255,255,255,255,0,113,65,0,75,4,64,32,0,16,23,5,32,0,32,1,65,255,255,255,255,120,113,65,128,128,128,128,2,114,54,2,4,32,0,65,16,106,65,3,16,34,11,11,11,73,1,1,127,32,0,40,2,4,34,1,65,128,128,128,128,7,113,65,128,128,128,128,2,70,4,127,32,1,65,128,128,128,128,120,113,69,5,65,0,11,4,64,32,0,32,1,65,255,255,255,255,120,113,54,2,4,32,0,65,16,106,65,5,16,34,35,2,32,0,16,14,11,11,243,1,1,6,127,35,5,34,5,34,2,33,3,35,3,33,0,3,64,2,64,32,3,32,0,79,13,0,32,3,40,2,0,34,4,40,2,4,34,1,65,128,128,128,128,7,113,65,128,128,128,128,3,70,4,127,32,1,65,255,255,255,255,0,113,65,0,75,5,65,0,11,4,64,32,4,16,22,32,2,32,4,54,2,0,32,2,65,4,106,33,2,5,65,0,32,1,65,255,255,255,255,0,113,69,32,1,65,128,128,128,128,7,113,27,4,64,35,2,32,4,16,14,5,32,4,32,1,65,255,255,255,255,7,113,54,2,4,11,11,32,3,65,4,106,33,3,12,1,11,11,32,2,36,3,32,5,33,0,3,64,2,64,32,0,32,2,79,13,0,32,0,40,2,0,16,24,32,0,65,4,106,33,0,12,1,11,11,32,5,33,0,3,64,2,64,32,0,32,2,79,13,0,32,0,40,2,0,34,1,32,1,40,2,4,65,255,255,255,255,7,113,54,2,4,32,1,16,25,32,0,65,4,106,33,0,12,1,11,11,32,5,36,3,11,88,1,2,127,2,64,3,64,32,0,35,0,78,13,1,65,0,33,1,3,64,2,64,32,1,35,1,78,13,0,35,0,32,1,108,32,0,106,65,2,116,65,0,54,2,0,35,7,35,0,32,1,108,32,0,106,65,2,116,106,65,0,54,2,0,32,1,65,1,106,33,1,12,1,11,11,32,0,65,1,106,33,0,12,0,11,0,11,11,77,1,3,127,16,27,3,64,2,64,32,0,35,6,78,13,0,16,1,35,0,183,162,170,33,1,16,1,35,1,183,162,170,33,2,32,2,69,65,1,32,1,27,69,4,64,35,0,32,2,108,32,1,106,65,2,116,65,128,128,128,120,54,2,0,11,32,0,65,1,106,33,0,12,1,11,11,11,156,5,1,3,127,65,1,33,0,3,64,2,64,32,0,35,0,65,1,107,78,13,0,65,1,33,1,3,64,2,64,32,1,35,1,65,1,107,78,13,0,32,0,65,1,106,35,0,32,1,65,1,107,108,106,65,2,116,40,2,0,65,128,128,128,120,70,4,127,65,1,5,65,0,11,32,0,65,1,107,35,0,32,1,65,1,106,108,106,65,2,116,40,2,0,65,128,128,128,120,70,4,127,65,1,5,65,0,11,35,0,32,1,65,1,106,108,32,0,106,65,2,116,40,2,0,65,128,128,128,120,70,4,127,65,1,5,65,0,11,32,0,65,1,106,35,0,32,1,108,106,65,2,116,40,2,0,65,128,128,128,120,70,4,127,65,1,5,65,0,11,32,0,65,1,106,35,0,32,1,65,1,106,108,106,65,2,116,40,2,0,65,128,128,128,120,70,4,127,65,1,5,65,0,11,32,0,65,1,107,35,0,32,1,108,106,65,2,116,40,2,0,65,128,128,128,120,70,4,127,65,1,5,65,0,11,32,0,65,1,107,35,0,32,1,65,1,107,108,106,65,2,116,40,2,0,65,128,128,128,120,70,4,127,65,1,5,65,0,11,35,0,32,1,65,1,107,108,32,0,106,65,2,116,40,2,0,65,128,128,128,120,70,4,127,65,1,5,65,0,11,106,106,106,106,106,106,106,33,2,35,0,32,1,108,32,0,106,65,2,116,40,2,0,65,128,128,128,120,70,4,127,65,1,5,65,0,11,4,64,2,64,2,64,2,64,32,2,69,32,2,65,1,70,114,69,4,64,32,2,65,2,70,32,2,65,3,70,114,13,1,32,2,65,4,70,32,2,65,5,70,114,32,2,65,6,70,32,2,65,7,70,114,114,13,2,32,2,65,8,70,13,2,12,3,11,35,7,35,0,32,1,108,32,0,106,65,2,116,106,65,0,54,2,0,12,2,11,35,7,35,0,32,1,108,32,0,106,65,2,116,106,65,128,128,128,120,54,2,0,12,1,11,35,7,35,0,32,1,108,32,0,106,65,2,116,106,65,0,54,2,0,11,5,2,64,2,64,2,64,32,2,69,32,2,65,1,70,32,2,65,2,70,114,114,69,4,64,32,2,65,3,70,13,1,32,2,65,4,70,32,2,65,5,70,114,32,2,65,6,70,32,2,65,7,70,114,114,13,2,32,2,65,8,70,13,2,12,3,11,35,7,35,0,32,1,108,32,0,106,65,2,116,106,65,0,54,2,0,12,2,11,35,7,35,0,32,1,108,32,0,106,65,2,116,106,65,128,128,128,120,54,2,0,12,1,11,35,7,35,0,32,1,108,32,0,106,65,2,116,106,65,0,54,2,0,11,11,32,1,65,1,106,33,1,12,1,11,11,32,0,65,1,106,33,0,12,1,11,11,65,0,33,0,3,64,2,64,32,0,35,7,78,13,0,32,0,35,7,32,0,106,40,2,0,54,2,0,32,0,65,4,106,33,0,12,1,11,11,11,37,0,32,1,35,1,65,1,107,72,65,0,32,1,65,0,74,65,0,32,0,35,0,65,1,107,72,65,0,32,0,65,0,74,27,27,27,11,124,1,1,127,65,103,33,2,3,64,2,64,32,2,65,25,78,13,0,32,0,32,2,106,32,1,16,30,4,64,32,0,32,2,106,35,0,32,1,108,106,65,2,116,65,128,128,128,120,54,2,0,11,32,2,65,1,106,33,2,12,1,11,11,65,103,33,2,3,64,2,64,32,2,65,25,78,13,0,32,0,32,1,32,2,106,16,30,4,64,35,0,32,1,32,2,106,108,32,0,106,65,2,116,65,128,128,128,120,54,2,0,11,32,2,65,1,106,33,2,12,1,11,11,11,16,0,35,0,35,1,108,36,6,35,6,65,2,116,36,7,11,220,1,0,32,0,65,156,2,73,4,64,15,11,32,0,65,16,107,33,0,2,64,2,64,2,64,2,64,2,64,2,64,32,1,65,1,71,4,64,32,1,65,2,70,13,1,2,64,32,1,65,3,107,14,3,3,4,5,0,11,12,5,11,32,0,16,20,12,5,11,32,0,40,2,4,65,255,255,255,255,0,113,65,0,77,4,64,65,0,65,128,1,65,203,0,65,17,16,0,0,11,32,0,32,0,40,2,4,65,1,107,54,2,4,32,0,16,22,12,4,11,32,0,16,24,12,3,11,32,0,40,2,4,34,1,65,128,128,128,128,127,113,32,1,65,1,106,65,128,128,128,128,127,113,71,4,64,65,0,65,128,1,65,214,0,65,6,16,0,0,11,32,0,32,1,65,1,106,54,2,4,32,1,65,128,128,128,128,7,113,4,64,32,0,16,23,11,12,2,11,32,0,16,25,12,1,11,65,0,65,128,1,65,225,0,65,24,16,0,0,11,11,44,0,2,64,2,64,2,64,32,0,65,8,107,40,2,0,14,3,0,0,1,2,11,15,11,32,0,40,2,0,34,0,4,64,32,0,32,1,16,33,11,15,11,0,11,3,0,1,11,11,159,2,6,0,65,8,11,45,30,0,0,0,1,0,0,0,1,0,0,0,30,0,0,0,126,0,108,0,105,0,98,0,47,0,114,0,116,0,47,0,116,0,108,0,115,0,102,0,46,0,116,0,115,0,65,56,11,55,40,0,0,0,1,0,0,0,1,0,0,0,40,0,0,0,97,0,108,0,108,0,111,0,99,0,97,0,116,0,105,0,111,0,110,0,32,0,116,0,111,0,111,0,32,0,108,0,97,0,114,0,103,0,101,0,65,240,0,11,45,30,0,0,0,1,0,0,0,1,0,0,0,30,0,0,0,126,0,108,0,105,0,98,0,47,0,114,0,116,0,47,0,112,0,117,0,114,0,101,0,46,0,116,0,115,0,65,160,1,11,51,36,0,0,0,1,0,0,0,1,0,0,0,36,0,0,0,73,0,110,0,100,0,101,0,120,0,32,0,111,0,117,0,116,0,32,0,111,0,102,0,32,0,114,0,97,0,110,0,103,0,101,0,65,216,1,11,35,20,0,0,0,1,0,0,0,1,0,0,0,20,0,0,0,126,0,108,0,105,0,98,0,47,0,114,0,116,0,46,0,116,0,115,0,65,128,2,11,21,3,0,0,0,16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,16]);const{Module:r,instantiate:o,Memory:a,Table:i}=WebAssembly;e.exports=function(e={global:{},env:{memory:new a({initial:10,limit:100}),table:new i({initial:0,element:"anyfunc"})}}){return o(n,e)}},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),a=async(e,t)=>{const n=new WebAssembly.Memory({initial:256}),r=new Uint32Array(n.buffer),a={env:{abort:()=>{},memory:n},imports:{width:e,height:t,f:function(e){console.log("f",e)}},Math:Math},i=await o()(a),{step:c,randomize:s,paint:u}=i.instance.exports;return{step:c,randomize:s,paint:u,memoryView:r}},i=(e,t)=>{const n=e*t,r=n,o=4278190080,a=0,i=new Uint32Array(2*n);function c(e,t,n=0){i[d(e,t)+n]=o}function s(e,t){c(e,t,r)}function u(e,t,n=0){i[d(e,t)+n]=a}function f(e,t){u(e,t,r)}function l(e,t,n=0){return i[d(e,t)+n]}function d(t,n){return n*e+t}function m(e){return e===o?1:0}function y(n,r){return n>0&&n<e-1&&r>0&&r<t-1}return{step:function(){for(let r=1;r<e-1;r++)for(let e=1;e<t-1;e++){const t=m(l((n=r)-1,(o=e)-1))+m(l(n,o-1))+m(l(n-1,o))+m(l(n+1,o+1))+m(l(n+1,o))+m(l(n,o+1))+m(l(n-1,o+1))+m(l(n+1,o-1));if(m(l(r,e)))switch(t){case 0:case 1:f(r,e);break;case 2:case 3:s(r,e);break;case 4:case 5:case 6:case 7:case 8:f(r,e)}else switch(t){case 0:case 1:case 2:f(r,e);break;case 3:s(r,e);break;case 4:case 5:case 6:case 7:case 8:f(r,e)}}var n,o;!function(){for(let e=0;e<r;e++)i[e]=i[e+r]}()},randomize:function(){!function(){for(let n=0;n<e;n++)for(let e=0;e<t;e++)u(n,e),u(n,e,r)}();for(let r=0;r<n;r++){const n=parseInt(Math.random()*e),r=parseInt(Math.random()*t);0!==n&&0!==r&&c(n,r)}},paint:function(e,t){for(let n=-25;n<25;n++)y(e+n,t)&&c(e+n,t);for(let n=-25;n<25;n++)y(e,t+n)&&c(e,t+n)},memoryView:i}};window.addEventListener("load",async()=>{const e=1666,t=426,n=document.getElementById("canvas");n.width=e,n.height=t;const r=n.getContext("2d"),o=r.createImageData(e,t),c=new Uint32Array(o.data.buffer),s=document.getElementById("radioWebAssembly"),u=document.getElementById("radioJS");let f;async function l(){(f=s.checked?await a(e,t):i(e,t)).randomize()}s.onclick=l,u.onclick=l,await l(),c.set(f.memoryView.slice(0,e*t)),r.putImageData(o,0,0);let d,m,y,p=!1;n.addEventListener("mousedown",e=>{p=!0}),n.addEventListener("mousemove",e=>{d=e.offsetX,m=e.offsetY}),n.addEventListener("mouseup",e=>{p=!1});const b=document.getElementById("fpsCounter");document.getElementById("widthLabel").innerText=`Width: ${e}`,document.getElementById("heightLabel").innerText=`Height: ${t}`,function n(){const a=new Date;p&&f.paint(d,m),f.step(),c.set(f.memoryView.slice(0,e*t)),r.putImageData(o,0,0);const i=new Date;y=i-a,setTimeout(n,1)}(),function e(){const t=Math.round(1e3/y);b.innerText=`FPS: ${t}`,setTimeout(e,1e3)}()})}]);
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.