GithubHelp home page GithubHelp logo

deck's Introduction

Deck Of Playing Card

The purpose of this project is to create a reusable API to generate a deck of playing cards. This deck can easily be utilized in any card game projects (Poker, Go Fish, Blackjack).

Usage

  • Package can be imported into any Golang project by using go get https://github.com/alishalabi/deck
  • Package can be cloned locally using git clone https://github.com/alishalabi/deck.git

Public methods

  • New(options ...func([]Card) []Card) []Card
    • Creates a new deck, pass in any number of options
  • DefaultSort(cards []Card) []Card
    • Reset cards to default order
  • Sort(less func(cards []Card) func(i, j int) bool) func([]Card) []Card
    • Allow user to implement custom sorting options
  • Shuffle(cards []Card) []Card
    • Assigns random order to each card in deck (seed based on time/date)
  • Jokers(n int) func([]Card) []Card
    • Adds a given number of jokers to deck
  • Filter(f func(card Card) bool) func([]Card)
    • Filters out given suits or ranks from deck
  • Deck(n int) func([]Card) []Card
    • Add multiple decks

Iterations

  • Create standard deck struct
  • Create method to generate standard deck
  • Create method to sort deck
  • Create method to shuffle deck
  • Create method to add jokers
  • Create method to filter out cards
  • Create method to multiple decks

deck's People

Contributors

alishalabi avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.