]> git.cworth.org Git - zombocom-ai/blobdiff - index.js
Add bus object to default state
[zombocom-ai] / index.js
index 9b7270b7673e03e1ae78c803b68c6af054551b9f..6aef48c06360b598ef68eb9d5bbaa0e02efce188 100644 (file)
--- a/index.js
+++ b/index.js
@@ -15,7 +15,7 @@ const port = 2122;
 
 const python_path = '/usr/bin/python3'
 const generate_image_script = '/home/cworth/src/zombocom-ai/generate-image.py'
-const run_turtle_script = '/home/cworth/src/zombocom-ai/run-turtle.py'
+const interpret_cairo_script = '/home/cworth/src/zombocom-ai/interpret-cairo-to-svg.py'
 const state_file = 'zombocom-state.json'
 const targets_dir = '/srv/cworth.org/zombocom/targets'
 const images_dir = '/srv/cworth.org/zombocom/images'
@@ -106,6 +106,13 @@ fs.readFile(state_file, (err, data) => {
                },
                state: "welcome",
                level: 0
+           },
+           bus : {
+               students: {
+                   names: [],
+                   count: 0,
+               },
+               state: "welcome"
            }
        };
     else
@@ -197,7 +204,7 @@ io_bus.on("connection", (socket) => {
 
     socket.on('run', code => {
        try {
-           output = child_process.execFileSync(python_path, [run_turtle_script, code], { input: code });
+           output = child_process.execFileSync(python_path, [interpret_cairo_script, code], { input: code });
            // Grab just first line of output
            const nl = output.indexOf("\n");
            if (nl === -1)