playing-cards

Version, currently master branch1 version
  • master branchlatestJul 22, 2018

github.com/jefffederman/playing-cards

Playing cards in Crystal

1 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  playing-cards:
    github: jefffederman/playing-cards
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
0.25.0
License
MIT
Author
Jeff Federman

Dependencies

This version declares no dependencies.

README

playing_cards

Playing cards in Crystal.

Installation

Add this to your application's shard.yml:

dependencies:
  playing-cards:
    github: jefffederman/playing-cards

Usage

require "playing-cards"

To create a new 52 card deck, just use:

deck = PlayingCards::Deck.new

To shuffle the deck, use:

deck.shuffle!

Most of the time, you'll want to start with a shuffled deck, so you can use:

deck = PlayingCards::Deck.shuffle!

To deal cards, use:

player_1_cards = deck.deal(3)

Development

There are no development dependencies other than Crystal. Feel free to make pull requests!

Contributing

  1. Fork it (https://github.com/your-github-user/playing_cards/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors