Skip to main content

Play Othello (Reversi) in your terminal against a 5-level AI

Project description

cli-othello

ターミナルでオセロ(リバーシ)を楽しめるCLIパッケージです。 5段階の強さから選べるAIと対局できます。

インストール

pip install cli-othello

使い方

othello

起動すると対局前にAIの強さ(Lv.1〜Lv.5)を選ぶ画面が表示されます。 強さを指定して直接対局を始めることもできます。

othello --level 3

操作方法

キー 動作
↑ / ↓ / ← / → (または h/j/k/l) カーソル移動
Enter / Space カーソル位置に着手
q 終了

盤面では、自分が置ける場所が緑色の · でハイライトされます。

AIの強さ

レベル 特徴
Lv.1 入門 ランダム性が高く、ほぼ気の向くままに着手
Lv.2 初級 浅い探索+盤面の位置評価を考慮
Lv.3 中級 角・辺の重要度や着手可能数(機動力)も評価
Lv.4 上級 より深く先読みしつつ盤面を評価
Lv.5 最強 深い探索(最大6手先)で最も精度高く着手を選択

内部的にはミニマックス法とアルファベータ枝刈りを用い、レベルごとに探索の深さと評価関数の精度を変化させています。

必要環境

  • Python 3.9以上
  • Windowsの場合は windows-curses が自動的に依存関係としてインストールされます

ライセンス

MIT

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

cli_othello-1.0.1.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

cli_othello-1.0.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file cli_othello-1.0.1.tar.gz.

File metadata

  • Download URL: cli_othello-1.0.1.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cli_othello-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4c1f17beeedb6f6fa05baf2ad7b18acc95c1d0684571e0cf95b9fd332ef54c74
MD5 ebfe1da590c879952e67b8a3864933b5
BLAKE2b-256 689bd4f959e92bcd99214b5c5b116469e3807089165965100c061d948e8a595a

See more details on using hashes here.

Provenance

The following attestation bundles were made for cli_othello-1.0.1.tar.gz:

Publisher: publish.yml on Lapius7/cli-othello

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cli_othello-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: cli_othello-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cli_othello-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bc9cca3de02aa0f961dca63a96d4514042db4253b8ebb4a98603b9b41ee38d69
MD5 489b0b222059ffb914b37631cb09678d
BLAKE2b-256 7f97b10c7080afe041b857f6801200f390c9764061eeeeedb9f8f9b7935e79d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for cli_othello-1.0.1-py3-none-any.whl:

Publisher: publish.yml on Lapius7/cli-othello

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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