Skip to content

Commit e6d6d4a

Browse files
committed
Document the rules and check the README against the solutions
Add check_readme.py, which fails if a link does not resolve, a solution file is not listed exactly once, the Size column disagrees with the number of commands in the file, the bold column does not match the file's type, or a less reliable solution does not beat the one above it. It counts commands the way the game does: labels, endif/endwhile/endfor and comments are free, else and end are not, and a condition split over several lines counts once. Run it on every pull request alongside check_names.py, and add mypy to the lint matrix now that tox covers both scripts. Add CONTRIBUTING.md covering how size and speed are measured, how solutions are ranked when they tie, how solutions that have to be pasted in are flagged, and how credit works. In the README, document SolutionsLowPercent and the rule that a less reliable solution is only listed if it is strictly better, note that years 08, 27 and 45 have no OCD challenge, explain what the columns and markers mean, mark solutions that cannot be typed into the editor with a clipboard, and rename Creator to Contributor since the column records who provided the solution here rather than who found it first.
1 parent eeff88f commit e6d6d4a

5 files changed

Lines changed: 435 additions & 3 deletions

File tree

.github/workflows/check-format.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: Check Formatting
22
on:
33
pull_request:
4+
push:
5+
branches: [master]
6+
permissions:
7+
contents: read
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
411
jobs:
512
Formatting:
613
runs-on: ubuntu-latest
@@ -13,5 +20,7 @@ jobs:
1320
uses: actions/setup-python@v7
1421
with:
1522
python-version: ${{ matrix.python-version }}
16-
- name: Check formatting is correct
23+
- name: Check file names are correct
1724
run: python check_names.py
25+
- name: Check the README matches the solutions
26+
run: python check_readme.py

.github/workflows/lint.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
name: Lint
22
on:
33
pull_request:
4+
push:
5+
branches: [master]
6+
permissions:
7+
contents: read
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
411
jobs:
512
lint:
613
runs-on: ubuntu-latest
714
strategy:
815
matrix:
916
python-version: ["3.13"]
10-
lint-type: [black, flake8]
17+
lint-type: [black, flake8, mypy]
1118
steps:
1219
- uses: actions/checkout@v7.0.1
1320
- name: Set up Python ${{ matrix.python-version }}

CONTRIBUTING.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Contributing
2+
3+
Thanks for helping collect the best 7 Billion Humans solutions! Anyone is welcome to submit an improvement, either as
4+
a [pull request](https://help.github.com/articles/about-pull-requests/) or on
5+
the [Steam thread](https://steamcommunity.com/app/792100/discussions/0/1739968490573286109/).
6+
7+
## Submitting a solution
8+
9+
1. Copy the solution out of the game and save it as a `.txt` file in the folder that matches how reliable it is
10+
(see [Which folder](#which-folder)).
11+
2. Name the file `Year NUM - NAME (TYPE).txt`, where `NUM` is the two digit year, `NAME` is the puzzle's name and
12+
`TYPE` is `speed`, `size` or `both`.
13+
3. Add or update the row in the matching README table, keeping the rows in year order.
14+
4. Run the checks:
15+
16+
```bash
17+
python check_names.py && python check_readme.py
18+
```
19+
20+
Both run automatically on every pull request.
21+
22+
## Which folder
23+
24+
| Folder | Success rate | Contents |
25+
|:------------------------|:-------------|:--------------------------------------------------------------------------|
26+
| `Solutions99+` | 99% or more | The main table. |
27+
| `Solutions50+` | 50% to 99% | Solutions that beat the `Solutions99+` entry but do not always succeed. |
28+
| `SolutionsLowPercent` | under 50% | Solutions that beat the entries above but only succeed occasionally. |
29+
30+
A less reliable solution is only listed if it is strictly better than the entry above it: fewer commands, or fewer
31+
steps. A solution that only ties is not listed, because the more reliable solution is already the better answer.
32+
33+
## How size and speed are measured
34+
35+
**Size** is the number of commands the game counts, which is what its editor shows. Labels (`a:`), block ends
36+
(`endif`, `endwhile`, `endfor`) and comments are free; every other line costs one command, including `else` and `end`,
37+
and a condition split over several lines still only costs one. `check_readme.py` counts this for you and fails if the
38+
README disagrees with the file.
39+
40+
**Speed** is the number of steps the game reports when the solution finishes. Solutions that rely on randomness do not
41+
have a fixed speed, so their value is written with a `~` prefix (`~155`) for a typical run, or as a range (`10-11`)
42+
when it varies between a couple of values.
43+
44+
## How solutions are ranked
45+
46+
The size and speed the game reports are the only numbers used. Two solutions with the same reported speed are
47+
considered equally fast, even though one may finish a fraction of a second sooner: the game does not show that
48+
difference, and there is no way to record it that a contributor could check. When two solutions tie on the value being
49+
optimised, the one that is better in the other column wins, and if they tie in both then the existing entry stays.
50+
51+
## Solutions that have to be pasted in
52+
53+
Some solutions use a command the game's editor will not let you build at that level, so they can only be entered by
54+
pasting the text in. Those rows are marked with 📋 in the README so you can tell before you try to reproduce them.
55+
56+
If you submit a solution that has to be pasted in, please say so in your pull request and add the marker. If you spot
57+
a listed solution that should be marked, open an issue or a pull request; the level a command becomes available at is
58+
easy to get wrong, so please say which command is not available and where you checked.
59+
60+
## Credit
61+
62+
The **Contributor** column records who provided the solution to this repository, which is not always the person who
63+
first discovered it. Many of these solutions were found independently by several people, and some were posted
64+
elsewhere first.
65+
66+
If you know of an earlier public posting of a solution, open an issue with a dated link to it (a Steam thread, a
67+
Twitch VOD, a forum post) and the credit will be updated. Where a contributor knows their solution was not the first,
68+
that is noted in a comment at the top of the solution file.
69+
70+
If you would rather be credited under a different name or link, say so in your pull request or open an issue.

0 commit comments

Comments
 (0)