Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a simulator to the editor #49

Open
wants to merge 46 commits into
base: master
Choose a base branch
from

Conversation

WilliamMayor
Copy link

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
Copy link
Author

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 :)

@ntoll
Copy link
Contributor

ntoll commented Mar 31, 2017

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! :-)

BPenhey and others added 6 commits May 1, 2018 17:31
Feature flag added for simulator
Gotten my head around the code, and made adjustments
Added the thermometer slider and made it update live

iframe has a seperate class so inline css not necessary; ignore the changes to the flags

microbit/__init__.js changes ESSENTIAL for actual functionality and clarity

simulator.html changes essential
simulator-ui.css, and simulator-ui.js ESSENTIAL

style.css changes ESSENTIAL

triangle.css changes ESSENTIAL
adeba-io and others added 8 commits May 2, 2018 17:08
Functioning accelerometer button added to simulator
These are changes ESSENTIAL:
__init__.js
mb.css
simulator.html
simulator-ui.css
Integrated new UI:
  Vertical stylr
  Buttons left of Microbit
  Attempt to add in Custom Tooltips
     PROBLEM: microbit div always appears over custom tooltips

WARNING: Yet to be thoroughly tested
@WilliamMayor
Copy link
Author

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.

@microbit-mark
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants