]> git.cworth.org Git - zombocom-ai/blobdiff - bus.html
Drop unneeded semicolons from python code
[zombocom-ai] / bus.html
index 845b048ec24039fd7792e2e9c1b81a1a649f7cb4..f16a509ae18bfea5b72955cf5a0f9d30be55c1d6 100644 (file)
--- a/bus.html
+++ b/bus.html
        Magic School Bus Central Processor
       </h1>
       <form id="form">
-       <textarea id="code" rows="10" width="100%">t.forward(100);
-t.right(90);
-t.forward(100);
-       </textarea>
+       <textarea id="code" rows="10" width="100%">def random_dot():
+  x = 200 * random()
+  y = 200 * random()
+  radius = 4 + 6 * random()
+  circle(x, y, radius)
+  fill()
+
+for i in range(100):
+  if i %2 == 0:
+    set_color('red')
+  else:
+    set_color('blue')
+  random_dot()</textarea>
        <button type="submit">Run code</button>
       </form>
       <img id="output"></img>
@@ -169,7 +178,6 @@ t.forward(100);
 
     form.addEventListener('submit', event => {
        event.preventDefault();
-       console.log("Submitted form with code: " + code.value);
        socket.emit('run', code.value);
     });