Created: 2008-12-11 10:37
Updated: 2019-01-23 18:29


Sheep In Your Shoes : A Game

"Screenshot of the game"


  • A simple game for the Shoes GUI toolkit by Why The Lucky Stiff. See

  • An educational aid for teaching programming concepts.

  • An illustration of object oriented programming principles: mapping the problem domain, encapsulation, modularity, interface.

  • A demo of modern 2D computer graphics and interactivity.

  • A testament of iterative, organic cultivating of the code toward it's better self


Because teaching programming concepts is hard.

When you have to teach basics of programming -- nota bene to humanities students -- things are sometimes too abstract. Particularly when you have to explain difference between various programming paradigms and why Object-Oriented Programming is (at least some) solution to „fragile code“.

The principles are laid out in the code of animals-oriented-on-objects.rb file. But you cannot see them. And you are not sure why do you make those silly classes anyway.

Things can be seen much clearly in the game. You suddenly know why a sheep is an „object“ and why we say it has some properties (like position, maybe?) and some messages (like „Run, baby, run!“) can be sent to it.

You also know how to start writing code. You usually start with something. A simple-bounce.rb file from samples included with Shoes in this case (see initial commit).

Then you gradually build up the environment of your game: you make the pasture green and put a sheep on it. You make the sheep move. You add more sheep and make them move. You add a dog, and make the dog catch the sheep. And so on. In the end you „refactor“ the syntax of the game, add documentation, things like that.

All of these steps are saved in Git repository tags 1 to 13, so you can easily do a git checkout 1, git checkout 2 to see development of the code and walk through it slowly.

Shoes and Ruby make all of this very, very easy. Ruby is probably the best language for teaching programming, for beginners and advanced alike. And with Shoes, you can just see everything.


  1. Download the Shoes platform from

  2. Open the sheep_in_your_shoes.rb file in Shoes

Binaries (not necessary up-to-date)

Written by Karel Minarik ( Published under MIT license.

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more