Coder Social home page Coder Social logo

card-game's Introduction

About

Welcome! The project structure is primarily:

.
├── lib
│   ├── classes.py  -->  Card, Deck, and Player classes
│   ├── config.py  -->  global variables
│   ├── decorate.py
│   ├── game.py  -->  controls game flow (look at this file first)
│   ├── utils.py
│   └── validate.py  -->  error messages and input validation
└── main.py  -->  kicks off the entire program

There is also a data folder that stores images and their corresponding generated "ascii image strings". The scripts crop.py and html_to_pystring.py automate part of the image generation. The generated strings are checked into the repository (data/strings/image_strings.py), so there is no need to rebuild them, but feel free to look at the scripts if you so please.

Installation

The dependencies are

  • Python 3.7 (sty requires python 3.5 or above)
  • sty (used to color text and ascii images in the terminal)
  • colorama (used to extend color support to Windows)
  • iTerm2 (this is not a dependency, but if you have issues with color support, I would recommend trying the program in this terminal)

Once you have python 3 installed, you should be able to install sty and colorama into your python 3 library with

cd card-game-matthew-lancellotti
python3 $(which pip) install -r requirements.txt

Unfortunately color support is a little dodgy on various terminals. If you have any issues, please don't hesitate to contact me.

Usage

Run the main.py script. For example:

cd card-game-matthew-lancellotti
./main.py

Next round.  It's Matt's turn!  press RETURN to draw.  Matt draws the king of diamonds.

card-game's People

Contributors

mareoraft avatar

Watchers

James Cloos avatar  avatar

card-game's Issues

images stretched vertically

  • scale down images (vertical squish) using PIL immediately after cropping so they don't appear stretched out (actually it looks nice though)

unit testing

To demonstrate best practices, there really should be some unit testing...

testing

Example

What you say: "A is a superset of B"
What you type: A.isSupersetOf(B)

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.