kipr / Simulator

Simulator of KIPR Demobots and code workspace.
GNU General Public License v3.0
12 stars 3 forks source link

[Semio] Scratch Support #461

Closed bmcdorman closed 1 month ago

bmcdorman commented 1 year ago

Overview

This PR adds Scratch support to the KIPR Simulator. It does this by embedding a highly customized scratch-blocks instance into the simulator. This customized version is stored at kipr-scratch. A custom VM is leveraged to run programs: itch. A C program is compiled as a part of static simulator dependencies and "hijacked" by itch to execute KIPR functions natively inside scratch.

List of Changes

  1. "Scratch" language option added to Editor
  2. Scratch programs saved like existing programs.
  3. Highly customized scratch editor integrated. See ScratchEditor.tsx and kipr-scratch.
  4. Custom runtime developed via itch and scratch-rt.js (see dependencies)
tcorbly commented 1 year ago

Program will not run anything else after repeat until block. Screenshot from 2023-02-21 16-01-30

tcorbly commented 1 year ago

We probably want a more distinguished line between block options and the editor space.

tcorbly commented 1 year ago

Issue related to either the gmpc or repeat until. The program throw errors when using a variable as part of the condition and also does not appear to either receive an output from gmpc or is skipping it for some reason.

As also seen in the image, many variables are automatically created for some reason. Screenshot from 2023-02-21 23-15-47