Skip to content

PttCodingMan/TriangularNim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

三角棋 Triangular Nim

這是三角棋[1]
開始時共有 15 個圈圈,玩家可以畫一個直線,只能消掉相鄰的一到三顆。
輪流畫到最後一顆的人輸。

此程式證明了有第一手有九種開局都存在必勝路徑,扣掉旋轉則為三種。

This is Triangular Nim[1] game.
There are 15 circles at the beginning, and the player can draw a straight line and eliminate one to three.
Take turns to eliminate the person who draws the last one loses.

This program proves that there is a winning path for all nine openings with the first move.

以下是九種存在必勝路徑的第一手。
The following nine openings all has a winning path.

  • 0
  • 3
  • 4
  • 5
  • 7
  • 8
  • 10
  • 12
  • 14

用法 Usage

跟電腦玩。
Play with computer.

python3 src/TriangularNim.py

跟電腦玩,顯示機率。
Play with computer and show probability.

python3 src/TriangularNim.py --probability or -P

計算必勝開局展示。
Count best move demo

python3 src/TriangularNim.py --demo or -D

Video 遊玩影片

IMAGE ALT TEXT HERE

獲勝機率公式 Winning probability formula

About

Triangular Nim game

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages