Browse Source

Add command line options

master
Noëlle 2 years ago
parent
commit
a8ec03ff70
No known key found for this signature in database
1 changed files with 9 additions and 2 deletions
  1. 9
    2
      brontes.py

+ 9
- 2
brontes.py View File

@@ -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…
Cancel
Save