Navigation:  Tutorials > Beginners Guide to Smalltalk > Programming in Smalltalk >

Playing the game

Previous pageReturn to chapter overviewNext page

We are now ready, with the addition of one last method, to play our Animal game. What we need is a single method to start the game off. Just for a little fun I've left the method box below blank, so see if you can guess how the Animal>>playGame should be written. Don't worry if you can't get it, just click on the tell me how link and I'll show you how it's done.

Animal class>>playGame

       "Start a new Animal game"

 

       tell me how

 

So now, to play the game just evaluate:

Animal playGame.

 

With a bit of luck you should be able to run through a few sessions with the game so that it learns some new animals. There is a pretty good chance, however, that something may have gone wrong as you worked through this chapter so here is a list of checkpoints.