PythonEditor icon indicating copy to clipboard operation
PythonEditor copied to clipboard

Adding a simulator to the editor

Open WilliamMayor opened this issue 8 years ago • 4 comments

Hi All,

Here's a PR from a group of students on a CS course. Take a look and see what you think.

I'll let them describe what they've done below:

We have incorporated a BBC micro:bit simulator into the python editor. We took the code for the simulator from https://create.withcode.uk, stripped out unnecessary functions, so we were left with a functioning simulator, and then added this to simulator.html before linking an iframe from the code editor to it.

To run the code from the editor on the simulator, through the iframe, we added a code tag to the URL, where it stores the code to be run in the URL, this could be changed by embedding the simulator directly into the editor.

Eventually, we would look to add back more of the advanced functionalities we stripped out, such as thermometer and compass GUIs, to give a more accurate simulation. The working version for this project can be found at - http://micro-edit.codeguild.co/editor.html.

Also, when we started on this project, to get a better feel for the code, we changed the save button functionality so that it asks the user for a name and description, before downloading the file.

WilliamMayor avatar Mar 31 '17 08:03 WilliamMayor

Also, I added some vagrant stuff so the students could get the website running on the classroom machines. There's also some instructions for them to get started. I can clean this up later :)

WilliamMayor avatar Mar 31 '17 08:03 WilliamMayor

Hi @WilliamMayor... please tell your students that this PR just made me snort my cup of tea through my nose in delighted surprise. Awesome work! I have a bunch of "real work" things to do but will review and, if necessary, add comments, suggestions and so on very soon.

Great work! Love it! Congratulations to all involved! :-)

ntoll avatar Mar 31 '17 09:03 ntoll

Hey! Just flagging that we've had another group of students do some work with the simulator. They've started to add extra functionality like accelerometer simulation, thermometer, and even started on simulating pin IO.

We've also put our version of the editor online so you can take it for a spin: https://pythoneditor.codeguild.co

There's obviously some work to be done to match the styling of the simulator with the styling of the editor. Let us know what your thoughts are there.

The students have finished their course now, so they've going home. I'm happy to put some hours in if you let me know what you'd to see. I'll also be running the course again in Nov/Dec this year, so we can get another group to put in some work.

WilliamMayor avatar May 04 '18 09:05 WilliamMayor

support-microbit:17671 Adding some more support for this feature and a user story from support: "what i'm looking for is a simulator like in the site makecode which is very good.

The new compulsory computer material of 1h30 per week arrives in France for all high school students in September 2019. Python is the language chosen and mandatory. Casio has also added the python now in their calculators."

@microbit-sam @jaustin

microbit-mark avatar Sep 25 '18 08:09 microbit-mark