Skip to main content

No project description provided

Project description

Poetry

Shastun Game Core

Overview

This project is a Python application using Python 3.12.3. The primary objective of this project is to provide a reusable core of Shastun Game.

Requirements

This project requires the following dependencies:

  • Python 3.12.3

Installation

To install the necessary packages, you can use pip:

pip install shastun

Usage

Describe how to use your project here. For example:

from shastun import User, Dice, Game

player1 = User("Alice")
player2 = User("Bob")
dice = Dice(sides=6, count=2)

game = Game(board_size=12, dice=dice, players=[player1, player2])

print("Shastun Game")

for i in range(3):
    print("Score |", " | ".join([f"{player.name}: {player.wins}" for player in game.players]))
    match = game.new_match()
    print(f"Match: {i + 1}")
    while match.finished is False:
        print(match.player, "[", match.board, "]", end=None)

        input("Press Enter to roll")

        throw = game.throw()
        print(throw)

        choices = game.choices(throw)

        if len(choices) > 0:
            print("Choose a value from the following options:")
            for index, choice in enumerate(choices, start=1):
                print(f"{index}. {list(choice)}")
            chosen_index = int(input("Enter the number of your chosen value: "))
            selected_choice = choices[chosen_index - 1]
            print("Selected:", list(selected_choice))
            match.move(selected_choice)
            print(game.match.board)
        else:
            print("No valid moves available.")

        print("")
        print(" - " * 20)
        print("")
        match.next_player()

    print("Match finished. Winner:", match.winner.name, "| Rolls:", match.score_for(match.winner))

print("Game finished.")
for player in game.players:
    print(f"{player.name}: {player.wins}")

Contributing

To contribute to this project, you can follow these steps:

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature-branch
  3. Make your changes and commit them: git commit -m 'Add some feature'
  4. Push to the branch: git push origin feature-branch
  5. Submit a pull request.

License

This project is MIT.

Contact

If you have any questions or issues, please contact "Besya gravisbesya@list.ru".

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shastun-0.1.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shastun-0.1.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file shastun-0.1.1.tar.gz.

File metadata

  • Download URL: shastun-0.1.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.3 Darwin/24.1.0

File hashes

Hashes for shastun-0.1.1.tar.gz
Algorithm Hash digest
SHA256 eedd8a6b0027445481cd39865ff0c7e963f6c454d2d4097cc39404911ae14e74
MD5 dde4220f02416f5cdc8022213f084392
BLAKE2b-256 d35fc6e7fcf9f7ca1ef1b3ed8a5530c74ab1a4782f02850cff43a1ab92dbe33b

See more details on using hashes here.

File details

Details for the file shastun-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: shastun-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.3 Darwin/24.1.0

File hashes

Hashes for shastun-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eb817e68d69e10fdc13d7c3b9e57e0a6f38aadc02e22b599882d1ecf3a3332e8
MD5 41edfd13ec74ec4ee2d5bc73e1a95f00
BLAKE2b-256 27b0a6d8dd7efbe57f495db11b1741c9c0ef6109903d94290a7dde7a1ad2be64

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page