You may be interested in the ideas in Papert's book Mindstorms and the application of Logo to education through "microworlds". Given rules and systems to work within (or possibly to define themselves), students are given the opportunity to explore the systems and the way things interact. Most people only seem to remember Logo for its turtle graphics, which allows an exploration of geometric and (through the connection of geometry and algebra) algebraic concepts. But there were also microworlds for physics (dynaturtles) and others.
----------
https://dl.acm.org/doi/pdf/10.5555/1095592 - PDF of the book.