top of page

DiscoG X Workshop 5: AI Learning from Rewards

  • Jun 13
  • 3 min read

Updated: Jul 17

DiscoG X Workshop 5 banner celebrating 10 years of DiscoG Coding Academy, 13 June 2026, with whiteboard grid activity in the background
Workshop 5 of DiscoG X, 13 June 2026. Ten workshops marking ten years of DiscoG Coding Academy.

What if you never told an AI the rules, and it had to work them out for itself, one mistake at a time?


That's the idea behind Reinforcement Learning, and it was the focus of Workshop 5 in our DiscoG X series.


AI Learning from Rewards was Workshop 5 / 10. You can see the full series here.



What was this workshop about?

Reinforcement learning is how many AI systems actually learn: not by being given a rulebook, but by trying something, seeing what happens, and adjusting.


Get it right, earn a reward.

Get it wrong, take a penalty.


Repeat enough times, and the system starts to know which moves are worth making.


Students looked at where this already shows up in their daily lives, from video games and recommendation systems to self-driving cars and robotics, before applying the idea themselves.


For today's project, that idea became a grid. Somewhere on it was a starting point, A, and an end point, B. The goal was to get from one to the other, but the grid also hid obstacles that couldn't be seen in advance. The only way to find them was to try moving and see what happened.


Python shell output showing a student's AI moving through a 5x5 grid, with score updates and messages for good moves and blocked squares.
The game engine in action, showing a live run through the grid, with points awarded or deducted after each move.

What the students built

Before writing any code, the class tested this together. One student at a time took on the role of the AI, calling out a move towards B: forward, back, left, or right. We played the role of the environment, telling them whether the move worked or whether they'd hit an obstacle.


Whiteboard grid with squares marked A and B, showing several coloured arrow paths and red crosses marking blocked squares, drawn as students took turns guessing directions.
The whiteboard grid used for the group activity, showing the paths tried and the obstacles ruled out as students worked their way from A to B.

The first few students had almost nothing to go on. They made reasonable guesses, knowing they were essentially guessing. But as the group worked through more of the grid, each student had more information than the last. Squares that had already been tried, directions that were known to be blocked, all of it built up in real time. By the later turns, students were calling out their moves with real confidence... though confidence didn't always mean they were right.


It was a clear, physical version of exactly what the AI does next: starting with nothing and getting better with every attempt, using what came before to make a more informed decision.


From there, students moved into Python. Using a pre-built game engine, they set their own reward and penalty values for each outcome, and wrote the messages their AI would display along the way for each type of move. Small changes to those numbers had a real effect on how the AI behaved, giving students a direct feel for how reward design shapes decision-making.


Python shell output showing a completed grid run with the AI's path from start to end, total score, and a table of learned values for each square and direction.
A completed run, showing the full path taken to reach B, the final score, and what the AI had learned about each square along the way.


Why this matters

Reinforcement learning sits behind AI systems young people already use without thinking about it. Building a version of it themselves, first as a group, then in code, turned an abstract idea to something they could see working in front of them.



Join us this summer

DiscoG X is a short series of workshops for Years 5 to 9, but DiscoG Coding Academy runs weekly term-time classes during the academic year as well as Summer Holiday Bootcamps for students in Years 1 to 13.


Whatever stage your child is at, there is a place for them here.


Summer Bootcamps are intensive and hands-on, with Specialised Courses built around the same approach you've seen in this post. Spaces fill up quickly.



Not able to make summer? Register your interest for September term-time classes to be one of the first to hear when spaces open.


Any questions? Get in touch!


Comments


Commenting on this post isn't available anymore. Contact the site owner for more info.
bottom of page