Skip to main content

batamiaou

Test

Battle game simulator

Introduction

Bata-Miaou (or similarly Bata-Waf) is a child variant of the "War" card game where there is actually no strategy to win (players can’t do anything).

This project implements a game simulator through a python C extension (limited C API).

Installation

pip install batamiaou

Usage

from batamiaou import BatamiaouGame

# create a new game instance
game = BatamiaouGame()
# run a whole game (it stops when a player has no more cards)
# and returns the number of rounds
rounds = game.run()
# reset the game
game.reset()
# run a single round and returns 1 or 2 (the winning player)
round_winner = game.play()

Deck

A BatamiaouGame embeds a deck attribute that an array of bytes of size 36 (char[36]), that represents the 36 cards of the game.

The value of the i-th card is (i % 6) + 1 (value between 1 and 6).

The elements of deck are used as follows:

Content of deck[i] Value Meaning
0b0001 1 The card i is the player 1 main deck
0b0010 2 The card i is the player 2 main deck
0b0101 5 The card i is the player 1 discard deck
0b0110 6 The card i is the player 1 discard deck
0b0000 0 The card i is currently involved in a battle (generally not seen)

This deck can be read at any time between hands.

# deck is a `bytes` object of length 36
deck = game.deck()
# to get the integers
values = [v for v in map(int, deck)]

You can also use numpy to ease further deck analysis:

import numpy as np

deck = np.frombuffer(game.deck(), dtype=np.uint8)

Metadata

Release files for batamiaou 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for batamiaou 0.1.0
File Size Uploaded Provenance Actions
batamiaou-0.1.0.tar.gz 9.1 kB Without provenance Details for batamiaou-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for batamiaou 0.1.0
File Interpreter ABI Platform Actions
batamiaou-0.1.0-cp36-abi3-manylinux1_x86_64.manylinux_2_5_x86_64.whl CPython 3.6 abi3 Linux glibc 2.5+ x86-64 Details for batamiaou-0.1.0-cp36-abi3-manylinux1_x86_64.manylinux_2_5_x86_64.whl

Total release size: 28.5 kB

Release files / batamiaou-0.1.0.tar.gz

Download URL batamiaou-0.1.0.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f576710f86d018640e24e2896c21541795a0f4536830de463a4e5307b5c27dd8
BLAKE2b-256 checksum
How to use checksums
9c5850599c2434438cc561d76aa3b2b144d9aae7ff87cb8e271e18af0c4e15ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / batamiaou-0.1.0-cp36-abi3-manylinux1_x86_64.manylinux_2_5_x86_64.whl

Download URL batamiaou-0.1.0-cp36-abi3-manylinux1_x86_64.manylinux_2_5_x86_64.whl
Size 19.4 kB
Tags CPython 3.6 Linux glibc 2.5+ x86-64 abi3
SHA-256 checksum
How to use checksums
92a65e6f8aa3d5eeabdc3b7c3b4cfd1222453b5565ebc6fb1d1e6d3ce5a8e729
BLAKE2b-256 checksum
How to use checksums
c1ed7b1aaa79c29a822aaf6f55a63f4e93764d58acd5f94956d2a918ddcd2c6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for batamiaou 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page