Does somebody have a simple example of a little game and the code that let save the game and its variables values?

Thanks.