Skip to content

ItsOkayItsOfficial/DeckofCards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Deck of Cards Builder, Shuffler, and Dealer in GO

Go Report Card Go Doc Release

A method (class in Java) that represents a deck of poker-style playing cards providing three operations.

Operations


buildDeck()

  • Builds a deck of 52 playing-cards with rank and suit values, returning that deck.

shuffle()

  • Shuffle returns no value, but results in the built deck being randomly permuted.
  • While not using a library-provided “shuffle” operation to implement this, in this case a source namespace overload function 'Shuffle' is used.

dealOneCard()

  • Function returns one card from the deck to the caller.
  • A call to shuffle followed by 52 calls to dealOneCard() will result in the caller being provided all 52 cards of the deck in a random order.
  • If the caller then makes a 53rd call dealOneCard(), no card is dealt, but rather a prompt returned.

Notes

About

Deck of cards builder, shuffler, and dealer in GO

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages