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: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.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
- Fork it (https://github.com/your-github-user/playing_cards/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- jefffederman Jeff Federman - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Jul 22, 2018
- Crystal
0.25.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/jefffederman/playing-cards
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 1