implementation of classic card game