Learners explore Artificial Intelligence by building and coding their own Pac-Man world.
The gohsts act as AI agents that follow programmed rules helping students understand how AI works through playful discovery.
Target Group
Students aged 9–12 (Swiss Primary Cycle 2)
Duration
60 minutes (Hour of AI format)
Language
English (interface available in multiple languages)
Required Tools
– ruler.game (free web app)
– iPads or laptops with internet
– Headphones
– Projector (optional)
Recognize AI’s role and influence in different contexts.
Evaluate AI outputs and decide if they make sense.
Connect AI’s limits to its programmed logic.
Collaborate with AI systems through testing and refinement.
I can recognize how the spirits use AI to find the shortest path.
I can decide if the AI’s path makes sense or needs revision.
I can explain that AI follows programmed rules.
I can share my Pac-Man level and reflect on what the AI is doing in my game.
What is Lehrplan 21?
Lehrplan 21 is the Swiss Curriculum, a national competence framework that defines what students in Switzerland should learn across all subjects. These connections show how the activity supports the development of digital and computational thinking skills outlined in this curriculum.
Media Competencies
MI.1.1 a: Students can share their experiences in their immediate environment, their media experiences, as well as experiences in virtual worlds, and talk about their media usage.
MI.1.3 b: Students can create and present simple image, text, and audio documents.
MI.1.3 f: Students can assess the effects of their own media contributions and take them into account during production.
Computer Science Competencies
MI.2.2 a: Students can recognize formal instructions and follow them.
MI.2.2 b: Students can try out different approaches to find solutions for simple problems and check them for correctness.
MI.2.2 e: Students understand that a computer can only execute predefined instructions and that a program is a sequence of such instructions.
MI.2.2 f: Students can write and test programs using loops, conditional statements, and parameters.
MI.2.3 a: Students can turn devices on and off, start, operate, and close programs, and use simple functions.
MI.2.3 d: Students can handle basic elements of a user interface.
Transversal Competencies
Self-reflection: Students can apply conclusions drawn from self-assessment and peer assessment.
Independence: Students can focus on a task and work on it with perseverance and discipline.
Problem-solving: Students can identify new challenges and design creative solutions.
Explore the game interface in advance.
Play a demo round and understand how AI controls the spirits.
Prepare simple metaphors for AI. For example:
“The spirits are like a GPS - they find the fastest route.”).
Prepare reflection questions:
Why did the spirits move this way?
Does AI ever make mistakes?
Where do we see AI like this in real life?
Test ruler.game on all school devices.
If the site is blocked by the school network, contact IT support.
Check internet access and browser compatibility (Safari, Chrome, Edge).
Ensure all devices are charged and earphones work.
Decide on pair or individual work.
Assign clear roles in pairs (builder / observer).
Anticipate different learning speeds using the built-in tutorial differentiation.
Multiple language support
Teachers can set the interface to English, German, or other available options depending on the class context.
Text-to-speech
Instructions and blocks can be read aloud to support students with reading difficulties or visual impairments.
Proxy-Based Programming
Prebugging reduces error rates by 10× through simultaneous visualization of current and future object states.
Provide a pre-built simple maze that they can modify.
Pair students to support each other (one builds, one observes).
Allow them to focus only on observing and describing spirits behavior, without designing a full level.
Encourage designing a complex maze with mor then two spirits.
Challenge them to predict spirits paths before testing.
Add a “debugging” task: create a maze where the spirits gets stuck, then fix it.
Encourage experimenting with code.
For example, by adding sounds.
The ZPF tutorial follows the Zone of Proximal Flow concept, helping students learn independently with just the right support.
Four buttons make navigation easy.
Learners move at their own pace using hints when needed or progressing on their own.
Collaborative Diffusion is a Collaborative Path-Finding AI algorithm inspired by the same diffusion mechanisms that underlie large language models (LLMs) like ChatGPT. It enables the creation of dynamic games like Pac-Man, where ghosts collaborate intelligently, something that would be very difficult to achieve without AI.
Solution: Test the site in advance. If blocked, contact IT support to request access.
Solution: Test internet connection or switch from wifi to hotspot.
Solution: Test in advance. If one device fails, switch browser or pair students with functioning devices.
Solution: Remind students the day before to fully charge devices.
Have extension cords and chargers ready in the classroom. Allow students to share devices in pairs if needed.
Solution: Guide them to see this as a learning moment: The AI always calculates the shortest path based on available rules.
Use guiding questions:
“What does the AI know about the maze?”
“What rules is it following?”
Check if they placed blocks under the blue walls.
The AI spirits will see this as a path and will use it. -> Follow the guided step by step instructions.
Solution: The tutorial should cover all the questions students may have during the process. If needed, demonstrate the first steps one by one using the projector. Encourage students to use the text-to-speech option if they find reading difficult.
Teacher should explore the help options on about.ruler.game and ruler.game before class.
Encourage students to work in pairs. Peers can often solve problems quickly.
Provide a clear escalation path: first ask your partner, then ask another pair, then call the teacher.
Although this activity is designed for the Hour of AI (60 minutes), ruler.game offers many possibilities for extended projects in computer science education. Teachers can use it to deepen students’ programming skills and foster creativity beyond the initial lesson.
Creative Game Design
Students can design their own complete games, not only Pac-Man. The platform allows importing self-drawn characters (e.g., scanned drawings or digital images). This makes the games more personal and motivates students to connect coding with their own creativity. Students can share their games with classmates, family, or online communities, encouraging authentic audiences for their work.
Programming Concepts
Ruler.game visualizes programming through proxymal debugging: each block and instruction is directly visible in the game world.
This helps students understand programming logic step by step.
Extended tasks can include:
Using loops, conditions, and variables in new contexts.
Adding multiple agents and testing how they interact.
Modifying rules to create new game mechanics (e.g., a spirits that avoids Pac-Man instead of chasing).
Student Agency and Reflection
Students document their design process in a portfolio (screenshots, descriptions, reflections).
They can present their games to peers, fostering communication and collaboration skills.
Teachers can integrate small competitions
(e.g., “Most creative maze,” “Best AI challenge”) to motivate learners.
Cross-curricular Projects
Art and Informatics:
Students draw characters and import them as sprites.
Language Learning:
Since the platform supports multiple languages and includes text-to-speech, students can practice vocabulary and instructions in English or other target languages.
Ethics and Society:
Discussions about AI limitations and fairness can be linked to real-world examples (navigation apps, recommendation systems).