Git Product home page Git Product logo

cards's Introduction

Cards

go run main.go deck.go -> Runs project.

go test -> Runs all tests in project.

Useful Functions

newDeck() -> Generates a standard deck, containing 52 cards.

{deckname}.print() -> Logs the contents of the deck.

{deckname}.toString() -> Converts a slice of type deck to a single string, where each element is separated by a comma.

{deckname}.saveToFile(filename) -> Converts a string to a byte slice before writing the byte slice to the specified filename.

removeFile(filename) -> Permanently removes a local file that matches the filename that was passed as a parameter.

newDeckFromFile(filename) -> Reads in the contents of a file and attempts to convert the contents to a deck.

deal(deck, handsize) -> Returns two decks. One deck will contain the amount of cards that was passed as the handsize, while the other deck will have the remaining cards.

{deckname}.shuffle() -> Randomly shuffles the order of every card in the deck.

Testing

All test functions follow GO Lang Standards, where each test file will end with "_test" and every function name will start with "Test....".

cards's People

Contributors

dilloncooper15 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.