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.0.tar.gz (5.0 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.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: shastun-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 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.0.tar.gz
Algorithm Hash digest
SHA256 3bb859bcf6dfee60f9f33c65013abb0d31606d9ab1fd69cae5df8bcb32b0a23e
MD5 887718ba248945a1205a9c6886505dbc
BLAKE2b-256 68a5913e350b8beaadd1171273004d8b3ff96d48513af9008cd910f1d0561fec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shastun-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6d92925c1cd60b26e84ffde3a9711bdf5d2ce5b081e5aed82bafc3c661668aa
MD5 779a3807c2f977e3cac36bf18ae9370f
BLAKE2b-256 0e96fcbed423676b4f4b9e7ff9d4c94c7dae976bf0d7e5dedec62177e9dbe113

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