PPO vs. the Viral Puzzle Game Everyone Loves to Hate
DI-sheep wraps the viral tile-matching game 'Sheep a Sheep' into a Gym environment and trains a PPO agent to beat it.

What it does DI-sheep is a complete training and inference stack for applying deep reinforcement learning to the viral tile-matching puzzle Yang Le Ge Yang (Sheep a Sheep). It provides a custom Gym environment that encodes the game’s stacking and matching rules, an Actor-Critic network built in PyTorch, and a browser-based React interface where humans or a trained PPO agent can play via a Flask backend. The project is built atop the DI-engine RL framework and releases pre-trained weights on HuggingFace, though it stresses the agent is still a work in progress.
The interesting bit The README openly admits the agent “still has much room for improvement”—a rare admission in AI gaming repos that frames the project as an ongoing benchmark for DI-engine rather than a solved stunt.
Key highlights
- Full React frontend and Flask backend for human or AI play in the browser.
- Custom
sheep_env.pyGym environment for the tile-matching mechanics. - PPO training pipeline using DI-engine with a PyTorch Actor-Critic model (
sheep_model.py). - Pre-trained model weights hosted on HuggingFace for immediate inference.
- Apache 2.0 license; explicitly designed as a showcase and extension of the DI-engine framework.
Caveats
- The authors note the AI agent is far from solved and remains a work in progress.
- Several core features are still on the roadmap, including game props, model-based RL, and detailed algorithm documentation.
- The online deployment is marked as under improvement.
Verdict Grab the code if you want a casual but non-trivial Gym environment for RL experiments, or if you are evaluating DI-engine’s usability. Skip it if you need a guaranteed winning solver or a polished, feature-complete mobile game.
Frequently asked
- What is opendilab/DI-sheep?
- DI-sheep wraps the viral tile-matching game 'Sheep a Sheep' into a Gym environment and trains a PPO agent to beat it.
- Is DI-sheep open source?
- Yes — opendilab/DI-sheep is open source, released under the Apache-2.0 license.
- What language is DI-sheep written in?
- opendilab/DI-sheep is primarily written in Python.
- How popular is DI-sheep?
- opendilab/DI-sheep has 518 stars on GitHub.
- Where can I find DI-sheep?
- opendilab/DI-sheep is on GitHub at https://github.com/opendilab/DI-sheep.