Git Product home page Git Product logo

card_roulette's Introduction

๐Ÿƒ Card Roulette

A Python package that simulates a thrilling card game where players draw cards, hoping to avoid the deadly one.

Description

Card Roulette is a text-based game where players draw cards in rounds. Each round, players draw cards randomly, and if a player draws the deadly card, they lose the round. The game introduces a new deadly card with each iteration (Iteration n's deadly card is card n). If the deadly card is the only one remaining, all players survive.

Rust Version

You can find the Rust version here.

Requirements

  • Python 3.6 or above

Installation

git clone https://github.com/Disciple0fMarx/card_roulette

Usage

cd card_roulette
python3 -m card_roulette

Playing a game

Default settings: 3 players, 3 rounds

python3 -m card_roulette play --players 4 --rounds 2

Simulating games

Default settings: 5 games, 3 players, 3 rounds

python3 -m card_roulette simulate --games 10 --players 4 --rounds 2

Results will be saved in the results folder like so:

results/
โ”œโ”€โ”€ 3_players/
โ”‚   โ”œโ”€โ”€ 3_rounds/
โ”‚   โ”‚   โ”œโ”€โ”€ 020549a8-1daf-43c2-a0d9-b0a49e31d860.csv
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ””โ”€โ”€ 4_rounds/
โ”‚       โ”œโ”€โ”€ a568cd44-9c4d-4ff2-a604-f100307040e4.csv
โ”‚       โ””โ”€โ”€ ...
โ”œโ”€โ”€ 4_players/
โ”‚   โ””โ”€โ”€ 2_rounds/
โ”‚       โ”œโ”€โ”€ fe54d3d1-ff4e-41f0-a579-e22d208163ea.csv
โ”‚       โ””โ”€โ”€ ...
โ”œโ”€โ”€ ...
โ””โ”€โ”€ total_results.json
  • <id>.csv contains the scores of all players in each game in the simulation with the given UID.
  • total_results.json stores the cumulative scores of each simulation.

card_roulette's People

Contributors

disciple0fmarx avatar

Stargazers

 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.