book cover
book cover

Programming Projects

Games with Cards

maintained by Francis Glassborow

  Home     

Card Emulation Library [45D]

Contributed by Francis Glassborow

Write a library to support the development of simple card game programs. Your library should provide for a simple standard pack of fifty-two cards. It should provide for both symbolic and graphical display of cards. It should have an effective shuffle routine and provide for dealing cards into 'hands'. It should support collation sequences (i.e. different ordering and ranking of cards such as Ace-high or Ace-low. But note that the library programmer cannot know all possible collation rules so must provide for some 'plug-in' facility.

The library should support the concepts of 'sequences', two, three or four of a kind, and trick taking.

The library should be designed for easy extension so that when you recognise some general concept used in multiple card games is missing it will be easy to add it.

Program elements

This project has the potential for considerable extension and the availability of a suitable library of this kind would make many other project with cards much easier. A C++ programmer would want to explore such concepts as traits classes.


  Home      Cards      Games      You Can Do It!