Consistent hero layouts, activity page redesign, new content, and YouTube embeds

- Product pages (Code Editor, Robot Simulator): text-left/image-right hero layout
- Related resources capped at 3 items on all product pages
- Making Music activities renamed to I, II, III
- New Maze I/II/III and Sumo I/II/III difficulty-graded activities
- YouTube demo videos restored on 12 activity pages from old site
- Activity pages: two-column hero with coding skills & rover concepts tags
- Blog/news pages: same two-column hero layout with date
- Resource type extended with codingSkills, roverConcepts, tags fields
- Removed raw "Relevant Coding Skills/Rover Concepts" text from activity MDX

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Tim Hadwen
2026-03-01 23:56:05 +10:00
parent 1dd622cbf5
commit 99534e779a
31 changed files with 853 additions and 1199 deletions

View File

@@ -0,0 +1,46 @@
---
title: "Activity: Maze III"
date: "2021-06-06"
categories: ["Activities", "All", "Simulator Activities"]
tags: ["Colour Sensors", "Branching", "Iteration", "Algorithm Design", "Ultrasonic", "IR", "Gyroscope", "Motors", "Functions", "Advanced"]
excerpt: "Master maze solving with precise gyroscope turns, wall-following algorithms, and functions to create an efficient maze navigator."
featuredImage: "/images/resources/maze.png"
---
Create an advanced maze solving algorithm that uses the gyroscope for precise 90-degree turns, implements a wall-following strategy, and organises code with functions for a clean, efficient solution.
![](/images/content/1cf38b-maze.png)
Activity Demonstration
### Setup
Build the most challenging maze you can. Use narrow pathways with only 3-5cm clearance on each side. Include loops, multiple paths, and dead ends. Add coloured sections on the floor for bonus tasks like changing speed or playing different sounds.
### Building On Maze II
In Maze II we used all three distance sensors to make better decisions. Now we'll add the gyroscope for precise turning, use functions to organise our code, and implement a proper wall-following algorithm.
#### Stage 1: Precise Turns With The Gyroscope
Instead of turning for a set time (which can be inaccurate), use the gyroscope to measure exactly how far the rover has turned. Create a function called `turnRight` that turns the rover exactly 90 degrees by reading the gyroscope and stopping when the target angle is reached. Do the same for `turnLeft`.
#### Stage 2: Wall-Following Algorithm
Implement a left-hand or right-hand wall-following strategy. The idea is simple: always keep a wall on one side. If the wall disappears (an opening), turn that direction. If the wall is ahead, turn the other way. This strategy guarantees the rover will eventually find the exit in any simply-connected maze.
#### Stage 3: Organise With Functions
Create functions for each behaviour: `moveForward`, `turnLeft`, `turnRight`, `checkWalls`, and `checkFinish`. Your main loop should read cleanly as a series of function calls. This makes the code easier to debug and modify.
#### Stage 4: Speed Optimisation
Once your rover can reliably solve the maze, optimise for speed. Move faster in straight sections and slow down when approaching walls or turns. Use the distance sensor readings to adjust speed dynamically.
### Challenge
Can you solve the maze as fast as possible? Time your rover and try to beat your personal best. Compare times with classmates to see who has the most efficient algorithm.
[Activity: Maze I](/resources/maze)
[Activity: Maze II](/resources/maze-ii)