Skip to content

Commit

Permalink
Minor edits to documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-rumpf committed Feb 14, 2021
1 parent 7d1c26e commit 73c973e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,22 @@ Running `combatturtles.py` from the command line automatically initiates a game.
```
usage: combatturtles.py [-h] [-v] [-f P1] [-s P2] [-a A] [-c LIM]
Initializes a game of Combat Turtles. Command line arguments can be supplied to
specify player AIs and the arena (see below for details). Excluding any of these
arguments will prompt the user to specify them on startup.
Initializes a game of Combat Turtles. Command line arguments can be supplied
to specify player AIs and the arena (see below for details). Excluding any of
these arguments will prompt the user to specify them on startup.
Note that the player AIs are indexed alphabetically, which may cause indices to
change as new modules are added to the ai/ directory.
Note that the player AIs are indexed alphabetically, which may cause indices
to change as new modules are added to the ai/ directory.
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-f P1, --first P1 player 1 ID
-s P2, --second P2 player 2 ID
-a A, --arena A arena ID
-c LIM, --cutoff LIM iteration cutoff
-f P1, --first P1 player 1 AI index
-s P2, --second P2 player 2 AI index
-a A, --arena A arena index
-c LIM, --cutoff LIM iteration cutoff (default: unlimited)
See full documentation online at <adam-rumpf.github.io/combat-turtles>
See full documentation online at <adam-rumpf.github.io/combat-turtles>.
```

In both cases the turtle AIs are indexed alphabetically beginning with `0`, which may change as more AI modules are added to the `ai/` directory. If a given ID is unspecified or invalid, the user will be asked to specify a value in the text-driven menu.
Expand Down
21 changes: 11 additions & 10 deletions combatturtles.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ def _arena_table(arenas):
Released under MIT License <github.com/adam-rumpf/combat-turtles>
"""
_desc = """
Initializes a game of Combat Turtles. Command line arguments can be supplied to
specify player AIs and the arena (see below for details). Excluding any of these
arguments will prompt the user to specify them on startup.
Initializes a game of Combat Turtles. Command line arguments can be supplied
to specify player AIs and the arena (see below for details). Excluding any of
these arguments will prompt the user to specify them on startup.
Note that the player AIs are indexed alphabetically, which may cause indices to
change as new modules are added to the ai/ directory.
Note that the player AIs are indexed alphabetically, which may cause indices
to change as new modules are added to the ai/ directory.
"""
_epil = ("See full documentation online at " +
"<adam-rumpf.github.io/combat-turtles>")
"<adam-rumpf.github.io/combat-turtles>.")

# Initialize game (options can be set from command line)
if __name__ == "__main__":
Expand All @@ -198,13 +198,14 @@ def _arena_table(arenas):
# Define arguments
parser.add_argument("-v", "--version", action="version", version=_vers)
parser.add_argument("-f", "--first", action="store", default=-1,
type=int, dest="p1", help="player 1 ID")
type=int, dest="p1", help="player 1 AI index")
parser.add_argument("-s", "--second", action="store", default=-1,
type=int, dest="p2", help="player 2 ID")
type=int, dest="p2", help="player 2 AI index")
parser.add_argument("-a", "--arena", action="store", default=-1,
type=int, dest="a", help="arena ID")
type=int, dest="a", help="arena index")
parser.add_argument("-c", "--cutoff", action="store", default=-1,
type=int, dest="lim", help="iteration cutoff")
type=int, dest="lim",
help="iteration cutoff (default: unlimited)")

# Parse command line arguments
args = parser.parse_args()
Expand Down

0 comments on commit 73c973e

Please sign in to comment.