I created a command line version of the game Freecell. I used a Model View Controller architecture in order to loosely couple the game logic with the output so that other interfaces can be created without touching the core logic. The model ensures the game state is valid (eg. a move follows the rules of the game, a card cannot be in two locations at once, etc.). The controller handles the business logic, and the view handles the text output.
If you'd like to see the code, please feel free to email me.