Giter VIP home page Giter VIP logo

tonk's Introduction

Tonk Card Game

Purpose of the Project

I decided to create the Tonk card game to excercise my Python3 knowledge with something I am familiar with. I knew that it would not be to dificult of a game to program so I jumped right in.

Rules Of The Game

  1. Each player starts off with 5 cards
  2. Player One starts their hand by either pulling a card from the deck or pulling a card from the discard pile.
  3. Once the player pulls the card, they decide which card they would like to discard, and then Player 2 follows the same path.
  4. At anytime each player has the option has to either Spread or Go Out.
    • Spread: A laid down run of three or more cards from the same suit in sequence (e.g. a 7 of Hearts, 8 of Hearts, and 9 of Hearts). A spread is also a book of at least three identically ranked cards from different suits (e.g. three Jacks).
    • Going Out: A player could "Drop" their cards and add up the total of the face value of the cards. Whoever has the lowest total wins.

Coding Progress

This was a journey of a project. I hit a couple road blocks along the way but was very determined to find the solution.

I started off by working on the main page of the project. I knew that I needed to create A list for deck and add the 52 cards to it. I also knew that I needed to create an empty list for both players hands.

Once I got to this point, I knew that i needed to create a function for the start of the game which is dealing each player their 5 cards. I created another file to house all of my function so that my main file would not be cluttered.

In that gameFunctions file I started and created the deal hands function which housed the randondom card function. The random card function basically takes a random card from the deck and adds it to the players hand.

Knowledge Learned

  1. randomint() function with 2 parameters (inclusive number, Number above Max) and gives you a random integer between your parameters.

  2. Try and Except in a Loop.

tonk's People

Contributors

oneway-laye 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.