Giter VIP home page Giter VIP logo

go-playingcards's Introduction

Playing Cards Project

This project provides a Go implementation for managing and manipulating a deck of playing cards. It includes functionalities for creating a deck, shuffling, drawing cards, and more.

Features

  • Create a standard 52-card deck
  • Shuffle the deck
  • Save the deck to file
  • Draw cards from the deck
  • Reset the deck

Installation

To use this project, you need to have Go installed on your machine. You can download and install Go from the official website.

Once Go is installed, you can clone the repository and install the dependencies:

git clone https://github.com/pgoulding/go-playingcards
cd go-playingcards
go mod tidy

Running the Project

You can run the project using the go run command:

go run main.go

Testing

This project includes unit tests for the various functionalities. To run the tests, use the go test command:

go test ./...

Usage

Here are some examples of how to use the different functionalities in this project:

Menu

Upon starting the program you should be shown a list of Options that yuou can select by entering a numerical menu option:

--- Playing Cards Menu ---
1. Create a new deck
2. Shuffle the deck
3. Deal a hand
4. Save deck to file
5. Show Remaining Cards
6. Quit

1. Create a new deck

This creates a brand new unshuffled deck.

2. Shuffle the deck

This takes the exsiting deck and shuffles the cards in a random order.

3. Deal a hand

This takes out 5 cards from the deck and shows them to you.

4. Save deck to file

This saves the existing deck to a "_deckfile" file.

5. Show remaining cards

This shows the remaining cards in the deck.

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

go-playingcards's People

Contributors

pgoulding avatar

Watchers

 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.