CarcassonneScore.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/usr/bin/env python
  2. """
  3. Carcassonne score keeping system.
  4. Copyright 2018-2019 George C. Privon
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. """
  16. import argparse
  17. import sys
  18. import cgame
  19. __version__ = "0.4.4"
  20. def getargs():
  21. """
  22. Get command line arguments.
  23. """
  24. parser = argparse.ArgumentParser(description="Carcassonne score keeping \
  25. system.")
  26. parser.add_argument('-c', '--config', default='CarcassonneScore.conf',
  27. help='Location of the configuration file.')
  28. parser.add_argument('--random-exp', default=False,
  29. help="Select a random set of active expansions and \
  30. mini-expansions.")
  31. return parser.parse_args()
  32. def main():
  33. """
  34. Main routine
  35. """
  36. args = getargs()
  37. mygame = cgame.cgame(args=args)
  38. mygame.runGame()
  39. sys.stdout.write("Thanks for playing!\n\n")
  40. if __name__ == "__main__":
  41. main()