有名ボドゲ、ゴブレットゴブラーズをPythonで使用可能にしたもの
Project description
install
pip install -U gobbletgobblers.py
How To Use
Create game
from gobbletgobblers import GobbletGobblers
gobb = GobbletGobblers(FirstPlayer, SecondPlayer, EmptyBoardText)
FirstPlayer - 先攻のプレイヤー
SecondPlayer - 後攻のプレイヤー
EmptyBoardText - 何も置かれていない場所に表示するテキスト
Variables mean
gobb.sen, gobb.kou
先攻、後攻プレイヤーの情報が格納
Attributes
player - Create Gameの手順で設定されたプレイヤー情報
gobbs - プレイヤーの所持している(新たに盤面に設置可能な)ゴブレット
color - プレイヤーの色(Red / Blue)
scolor - プレイヤーの色の略版(r / b) 基本的に内部でのみ使用
modes - プレイヤーが選択できるモード(初期: ['p'])
gobb.empty_board_text
Create Gameの手順で設定された文字列
gobb.turn
現在進行しているターン数
gobb.now_player
現在のプレイヤー
Attributesはgobb.sen, gobb.kouと同じ
gobb.won
勝者が出たかどうか
gobb.winner
勝者
Attributesはgobb.sen, gobb.kou, gobb.now_playerと同じ
gobb.board
盤面情報
gobb.board
├─a1
│ ├─ t
│ ├─ b
│ ├─ m
│ └─ s
├─a2
│ ├─ t
│ ├─ b
│ ├─ m
│ └─ s
├─a3
│ ├─ t
│ ├─ b
│ ├─ m
│ └─ s
.
.
.
a1, a2, a3... - 盤面の座標
+----+----+----+
| a1 | a2 | a3 |
+----+----+----+
| b1 | b2 | b3 |
+----+----+----+
| c1 | c2 | c3 |
+----+----+----+
t - top その座標におけるもっとも大きいゴブレット
b - big 一番大きいゴブレット
m - medium 普通サイズのゴブレット
s - small 一番小さいゴブレット
gobb.choices_put
putモード時に設置可能な場所を返す
choices_put = gobb.choices_put()
gobb.put
指定の座標に指定のサイズのゴブレットを配置
gobb.put(place, size)
place - 配置する座標
size - 配置するゴブレットのサイズ
gobb.choices_move_from
moveモード時に動かすことのできるゴブレットの座標を返す
choices_move_from = gobb.choices_move_from()
gobb.choices_move_to
moveモード時に指定のゴブレットを移動させられる座標を返す
choices_move_to = gobb.choices_move_to(from)
from - 移動前のゴブレットの座標
gobb.move
ゴブレットを移動させる
gobb.move(from, to)
from - 移動前のゴブレットの座標
to - 移動後のゴブレットの座標
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for gobbletgobblers.py-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c50cb7c693642dc66872ce666d7cbaff2e68040514d11249f62cf0d78b967165 |
|
MD5 | c9a254274f3b75d6747f96f7fb9793c0 |
|
BLAKE2b-256 | a762f5f2cf0517c3eec93f0dada90dfe36425151b14071902fd6c682b691c0bf |