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.3.tar.gz (10.2 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.3-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cli_othello-1.0.3.tar.gz
  • Upload date:
  • Size: 10.2 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.3.tar.gz
Algorithm Hash digest
SHA256 2ad33b948779f399b0aacd0175b73244472490fc3ae8e06d4273289cebc73d32
MD5 b2eb08203bc8ffe11f3de2569dbf0a67
BLAKE2b-256 7a505b3dab5fdc6688912cec71d24613f0de5cbd831e786129f9f120b6d2c75e

See more details on using hashes here.

Provenance

The following attestation bundles were made for cli_othello-1.0.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: cli_othello-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.6 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5e96d1f493b3f1f93a2c890bb72a3d21efabe1c08ff6a2564ef8bd5a113c6415
MD5 1398dbccbde82229078ebfa8ff600661
BLAKE2b-256 1675780d296d80f9a10e7deb43b540cd8b6181a22cdf52aef986c49ae26aeb78

See more details on using hashes here.

Provenance

The following attestation bundles were made for cli_othello-1.0.3-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