瀏覽代碼

Add command line options

master
Noëlle 2 年之前
父節點
當前提交
a8ec03ff70
沒有發現已知的金鑰在資料庫的簽署中
共有 1 個文件被更改,包括 9 次插入2 次删除
  1. 9
    2
      brontes.py

+ 9
- 2
brontes.py 查看文件

@@ -1,3 +1,4 @@
import argparse
from random import randint, shuffle

class Sibling:
@@ -194,5 +195,11 @@ class GameState:
print(out_str)

if __name__ == "__main__":

gs = GameState(rounds=100000, siblings=3, common_brother=True, verbose=False)
parser = argparse.ArgumentParser()
parser.add_argument("-r", "--rounds", help="Number of game rounds to simulate", type=int, nargs="?", default=10000, const=10000)
parser.add_argument("-s", "--siblings", help="Number of players", type=int, nargs="?", default=3, const=3)
parser.add_argument("-c", "--common_brother", help="The siblings share a brother, instead of each having their own", action="store_true")
parser.add_argument("-b", "--brother_count", help="How many times can a brother overwhelm a sibling?", type=int, nargs="?", default=3, const=3)
parser.add_argument("-v", "--verbose", help="Each round prints its results", action="store_true")
args = parser.parse_args()
gs = GameState(rounds=args.rounds, siblings=args.siblings, common_brother=args.common_brother, brother_count=args.brother_count, verbose=args.verbose)

Loading…
取消
儲存