Giter VIP home page Giter VIP logo

triangularnim's Introduction

三角棋 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

triangularnim's People

Contributors

changingtecadmin avatar pttcodingman avatar truth1987 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.