spook

A "game" for the 2023 Autumn Lisp Game Jam. Won first place! (from the bottom...)
git clone https://kaka.farm/~git/spook
Log | Files | Refs | LICENSE

cells.html (758B)


      1 <html>
      2 <head>
      3   <script src="spock-runtime-debug.js"></script>
      4   <script src="srfi-25.js"></script>
      5   <script type="text/javascript">
      6 
      7 var cells = new Array(900);
      8 var col = true;
      9 
     10 function create() {
     11 for(x = 0; x < 30; ++x) {
     12     for(y = 0; y < 30; ++y) {
     13 	var c = document.createElement("div");
     14 	cells[ y * 10 + x ] = c;
     15         c.style.left = (50 + x * 5) + "px";
     16         c.style.top = (50 + y * 5) + "px";
     17         c.style.backgroundColor = col ? "red" : "green";
     18         c.style.position = "absolute";
     19         c.style.width = 5;
     20         c.style.height = 5;
     21         col = !col;
     22 	document.body.appendChild(c);
     23     }
     24 }
     25 }
     26 
     27 setTimeout(create, 1000);
     28 
     29 </script>
     30 </head>
     31 <body style="background-color: #ffffff;">
     32 </body>
     33 </html>