We working to create an AP CS Principles course based on MakeCode Arcade. In one of the units of this course, students need to complete a bunch of Robot Tracing exercises like this:
The Robot is represented as a triangle, the grid is a 7 x 7 matrix, and there are only 3 functions - Move Forward (1), Turn Right, and Turn Left.
If anyone has some time, I would be eternally grateful if you want to try implementing this in MakeCode Arcade (maybe as an extension with custom blocks?) Would love to include it in the CSP course!
What is this:
supposed to do?
n = 1 and n = n +1
it’s just the weird notation that the CS Principles course uses to try and be language agnostic…
Seemed like a fun project. I put together a very simple implementation over lunch:
You’ll notice there’s a new
RoboDrawing category that has the three blocks you mentioned plus a
reset function (which is also required to initialize the sprite and grid).
Right now the sprite just follows instructions blindly; it doesn’t verify that it doesn’t move outside the bounds of the grid or anything…
… also I didn’t spend much time coming up with good names for the blocks or adding documentation.
Feel free to modify/improve the code any way you like.
Wow!!! Jacob, I love this, it’s perfect! Thanks so much for doing this. Will get this included in the course curriculum - lots of kids will be playing this! Do you want me to add a credit/link to you below the game?
No, no credit necessary. Glad to hear it might be useful!
Quick question - would it be possible for the Reset function to take a coordinate value? So students could place the robot on any of the tiles?
@jacqueline.russell I was interested in seeing some additional exercises of this type, so I hunted around a bit. I found a few in this code.org curriculum: https://curriculum.code.org/csp-20/unit5/5/.
Those examples appear to use a different grid size, starting location for the robot, and starting orientation of the robot. (It also looks like there may be obstacles and an additional conditional instruction later on…)
Do any of your curriculum’s exercises involve different grid sizes or starting configurations (position/orientation)?
Ha; yes. I just posted this as a question but it’s awaiting moderation.
@jacqueline.russell Here is an update to the robot drawing with the ability to customize the starting location and direction:
➗ are all listed, but if you pick the wrong one, you can swap over to another.)
… but I really don’t like the JS that it creates. Is it a priority that the generated JS be reasonable? Will the students be looking at that code?
I can roll back that change if it’d be better to force them to swap blocks to change turning directions.
We’ve built a similar project for hour of code campaign( but no i18n (yet)), same purpose with some features for new coders.
a) Navigating mode, in which students can navigate levels and draw flowcharts on paper or planning their programs (simulator automatically restart after changes detected)
b) Summary after running all levels;
c) Barriers like walls / boulders, context for introducing conditionals (if…then…)
Oh Wow! Looks very slick!