Giter VIP home page Giter VIP logo

diceroll's Introduction

dicerollimage

diceroll is a Python library that provides API functionality (dicerollAPI) for simulating dice rolls and performing dice-related operations.

It includes classes for rolling dice, tracking & saving roll results, and animating dice rolls using Pygame (optional)

API documentation starts here: https://github.com/ViciousSquid/diceroll/blob/main/Docs/dicerollAPI.md

Features

  • Roll various types of dice (e.g., 2d6, 1d20, 3d8+1d4) and get the roll results
  • Console printing and logging
  • Save the last 5 roll results to a file (.txt or .json)
  • Retrieve the last 5 roll results
  • Saving throws and skillchecks
  • Set/Get the dice/font color (red, white, blue, black, green, custom)
  • Animations (optional, requires Pygame)

Further Documentation

https://github.com/ViciousSquid/diceroll/tree/main/Docs


Source files:

diceroll.py : Contains the DiceRoller and OutcomeDeterminer classes, as well as the roll_dice function.

diceroll_anim.py : (optional) Contains the DiceAnimator class, which handles animation using the Pygame.

diceroll_api.py : Exposes dicerollAPI classes and defs

diceroll_enums.py

Example.py and Example2.py : Commented demos of the roll_dice function in the console.

Example3_gui.py : A simple demo of an animated roll that returns a result (requires pygame)


This API was custom-designed for use in the Adventure! Interactive story engine : https://github.com/ViciousSquid/Adventure

diceroll's People

Contributors

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