you will need array that holds value of the cards
cardholder= new array("good1","good2","good3","good4","bad1",...etc)
and you need to shuffle that array.(i guess you will need shuffling code)
then you place the card according to that shuffled value.
that will give you basic structure.
try to make something anything and if you are stuck..ask again.