{"size": 2879, "ext": "scrbl", "max_stars_repo_path": "scribblings/rules.scrbl", "max_stars_repo_name": "mfelleisen/Fish", "max_stars_repo_stars_event_min_datetime": "2021-05-12T01:04:29.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-21T06:33:51.000Z", "max_issues_repo_path": "scribblings/rules.scrbl", "max_issues_repo_name": "mfelleisen/Fish", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "scribblings/rules.scrbl", "max_forks_repo_name": "mfelleisen/Fish", "max_forks_repo_forks_event_min_datetime": "2021-06-11T04:57:36.000Z", "max_forks_repo_forks_event_max_datetime": "2021-06-11T04:57:36.000Z"}
{"max_stars_count": 5, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 29.9895833333, "max_line_length": 82, "alphanum_fraction": 0.6686349427}
#lang scribble/manual

@(require "shared.rkt")

@; -----------------------------------------------------------------------------
@title{@blue{The Rules; How to Play}}

The essential rules are spelled out in the paragraph labeled ``Basic Idea.'' In
addition to those, players need to know that
@itemlist[

@item{The referee allocates @math{6 - n} penguins to each player, where @math{n}
is the number of players at the beginning of the game.}

@item{The referee then requests players to place all of their penguins, one at a
time, at the beginning of the game.}

@item{Once all penguins have been placed, the referee calls on players to move
one of their penguins to a different spot until no player can move any
penguins.}

@item{The referee does not ask a player to move a penguin if the current state
of the game does not allow so. Such a player is in a @emph{locked state.}}

@item{A player has only so much time to respond to a referee's request. If a
player does not respond in a timely fashion, the referee disconnects from this
player. All of the player's penguins are removed from the board though the tiles
on which they stand are left in play. Disconnecting a player may thus free up
locked players.}

@item{When a game ends, the players are ranked according to the number of
penguins they own (caught).}

]

@; -----------------------------------------------------------------------------
@bold{How to Play A Game}

Assuming you have installed the repository---see the top entry of the
@tt{README} file---navigate to the @tt{Scripts} directory:
@verbatim[#:indent 4]{
$ cd Scripts
}

If you just want to observe a game, run @tt{xobserve}:
@;
@verbatim[#:indent 4]{
$ ./xobserve 
}
@;

If you wish to play with some number of players, run @tt{xplay}: 
@;
@verbatim[#:indent 4]{
$ ./xplay
}
@;
This command-line will start a game with a fixed configuration of some mechanical
players plus one GUI for a human player. When the game is over, the program prints
the result to the console.

You can also configure the game with optional arguments:
@;
@verbatim[#:indent 4]{
$ ./xplay players = 3                                   [1]
... 
$ ./xplay players = 1 row = 4 columns = 3               [2]
... 
$ ./xplay players = 3 row = 4 columns = 3 fish=5        [3]
... 
}
@;
Line 1 overrides the default number of players. Line 2 also overrides the row x
column format. And line 3 tells the script to place 5 fish on every tile, making
the game deterministic and boring. 

If you know JSON, you can set up a JSON configuration file and point the
script to this file:
@;
@verbatim[#:indent 4]{
$ cat config-n.json

{ "players" : 4,
  "rows" : 5,
  "columns" : 4,
  "fish" : 2 }
  
$ ./xplay --file config-n.json 
}
@;

For additional configuration options, see @tt{README} in @tt{Scripts/}.

To terminate the program before the game is over, use @tt{ctrl-c} at the console. 

