Skip to content

Commit

Permalink
Fix Chess960 link.
Browse files Browse the repository at this point in the history
  • Loading branch information
donkirkby committed Oct 21, 2023
1 parent 8b8e5d7 commit fc6d187
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
15 changes: 9 additions & 6 deletions docs/new_rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ know what you think.
* [Cloak and Dagger Chess][cloak-and-dagger-chess] is a game where you
disguise your chess pieces as checkers, then try to identify your
opponents pieces. (2 players, chess set, and checkers set)
* [Chess 960][chess-960] is a game designed by Bobby Fischer to mix up
the game opening by randomly choosing your starting position. (Chess
set and deck of cards)
* [Chess960][chess960] is a game designed by Bobby Fischer to mix up
the game opening by randomly choosing your starting position. (2
players, chess set, and deck of cards)

[crowded-house]: #crowded-house
[cloak-and-dagger-chess]: #cloak-and-dagger-chess
[chess-960]: #chess-960
[chess960]: #chess960

## Crowded House
Two teams of two play, with each player moving the pieces of their colour
Expand Down Expand Up @@ -92,8 +92,11 @@ Here's one possible way to fill in your grid at the start of the game:
![Diagram](images/new_rules/diagram3.png)

At the start of your turn, you may guess the identity of one of your opponent's
checkers. If you guess correctly, you make two moves in the current turn.
If you guess incorrectly, your turn is over.
checkers. If you guess correctly, you may make a bonus move after your regular
move. Your bonus move may be either a regular pawn move or to take back a pawn
that your opponent captured and drop it on an empty square in your second rank.
If you guess incorrectly, your opponent may make the same kind of bonus move
before their next turn.

At the end of your turn, you may replace any number of your checkers with their
uncloaked chess pieces.
Expand Down
10 changes: 10 additions & 0 deletions publish_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def main():
images_path.mkdir(parents=True, exist_ok=True)
contents_path = markdown_path.parent / (rules_stem + '_contents.csv')
contents_descriptions = load_contents_descriptions(contents_path)
unlinked_section_names = set(contents_descriptions)
register_fonts()

with args.markdown:
Expand Down Expand Up @@ -293,6 +294,7 @@ def main():
logger.info(state.text)
linked_text = doc.create_link(state.text)
flowable = Paragraph(linked_text, styles[state.style])
unlinked_section_names.discard(state.text)
if bulleted:
create_list_flowable(bulleted,
group,
Expand Down Expand Up @@ -351,6 +353,14 @@ def main():
f'<a href="https://creativecommons.org/licenses/by-sa/4.0/">'
f'{datetime.now().year}</a>',
centred_style))
if unlinked_section_names:
if len(unlinked_section_names) > 1:
suffix = 's'
else:
suffix = ''
unknown_section_message = (f'Unknown section{suffix} in contents: ' +
', '.join(unlinked_section_names))
raise ValueError(unknown_section_message)
doc.multiBuild(story, canvasmaker=partial(FooterCanvas,
font_name='Raleway',
is_booklet=args.booklet))
Expand Down
2 changes: 1 addition & 1 deletion raw_rules/new_rules_contents.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
heading,description
Crowded House,"is the only four-player game I know of on a standard set. (4 players and chess set)"
Cloak and Dagger Chess,"is a game where you disguise your chess pieces as checkers, then try to identify your opponents pieces. (2 players, chess set, and checkers set)"
Chess 960,"is a game designed by Bobby Fischer to mix up the game opening by randomly choosing your starting position. (Chess set and deck of cards)"
Chess960,"is a game designed by Bobby Fischer to mix up the game opening by randomly choosing your starting position. (2 players, chess set, and deck of cards)"

0 comments on commit fc6d187

Please sign in to comment.