Answer architecture round 3: open each place with the dimensions it moves, fail a scoring run nothing calls, test the base rule and a standing ratchet, and state the base rule whole
This commit is contained in:
@@ -37,15 +37,15 @@ opens with its label, written exactly: `Junior A:`, `Mid A:`, `Maintainability s
|
||||
|
||||
Mid A: Navigation same, Locality worse, Shape same, Self-sufficiency same, Overall worse
|
||||
|
||||
- `bin/x.py:12` `run`: Locality: three branches to hold at once
|
||||
- Locality: `bin/x.py:12` `run`: three branches to hold at once
|
||||
|
||||
Inherited architect: Navigation same, Locality worse, Shape same, Self-sufficiency same, Overall worse
|
||||
|
||||
- `bin/x.py:12` `run`: Locality: ...
|
||||
- Locality: `bin/x.py:12` `run`: ...
|
||||
|
||||
record-ruling takes Mid A's and the inherited architect's votes on each dimension and overall,
|
||||
each better, same or worse. Each place names the dimensions it moves, or Overall, spelled as the
|
||||
seat's line spells them. A dimension's vote counts as same unless one of the seat's places in
|
||||
each better, same or worse. Each place opens with the dimensions it moves, or Overall, spelled as
|
||||
the seat's line spells them and joined by `, `, then `: `. A dimension's vote counts as same unless one of the seat's places in
|
||||
backticks, `path:line`, names that dimension; the overall vote counts as same unless the seat names
|
||||
any such place. The printed votes say so. When the two counted overall votes differ, it appends
|
||||
nothing and prints `Split:`, saying to add the maintainability senior's and Junior A's lines.
|
||||
@@ -59,7 +59,8 @@ architect's lines in that order, or a `Mean:` line alone for a run moved from a
|
||||
Each line is `Navigation <n>, Locality <n>, Shape <n>, Self-sufficiency <n>, Overall <n>`, each
|
||||
score from 1 to 10 and the overall at most 1 above the line's lowest dimension. Its first line
|
||||
names no `, against`. It appends the seats' scores and their means, rounded half up to two
|
||||
decimals, and prints the means and each one under the floor of {floor}. A `Floor:` line says the
|
||||
decimals, and prints the means and each one under the floor of {floor}. It exits 1 on a run with
|
||||
seats that no plan item, release or fall calls. A `Floor:` line says the
|
||||
means under the floor block the merge, as they do when needs-scoring-run would give a reason
|
||||
besides a fall. When the history ends on a
|
||||
paired ruling with a `Fell:` line, it says whether the ruling stands; when a dimension that fell is
|
||||
@@ -247,6 +248,8 @@ def record_scoring(default: str, seats_file: pathlib.Path, ids: list[int]) -> Fa
|
||||
blocking = due_reasons(default, ids, [])
|
||||
if isinstance(blocking, Failure):
|
||||
return blocking
|
||||
if not (blocking or given.moved_mean or pending_fall(recorded)):
|
||||
return Failure("no plan item, release or fall calls this scoring run; name the item IDs the chunk ships, as needs-scoring-run took them")
|
||||
print(f"Means: {', '.join(f'{name} {value}' for name, value in zip(DIMENSIONS, mean))}. {floor_verdict(under_floor(mean), blocking)}")
|
||||
outcome = fall_outcome([] if given.moved_mean else pending_fall(recorded), mean)
|
||||
if outcome:
|
||||
|
||||
@@ -23,8 +23,8 @@ def votes(seats: list[Seat]) -> dict[str, list[str]] | Failure:
|
||||
line = vote_line(seat.name, seat.said)
|
||||
if isinstance(line, Failure):
|
||||
return line
|
||||
if unnamed := [place for place in seat.places if not any(re.search(rf"\b{name}\b", place) for name in DIMENSIONS)]:
|
||||
return Failure(f"{seat.name}'s place names none of {', '.join(DIMENSIONS)}, spelled so: {unnamed[0]}")
|
||||
if unnamed := [place for place in seat.places if not place_dimensions(place)]:
|
||||
return Failure(f"{seat.name}'s place does not open with the dimensions it moves, each one of {', '.join(DIMENSIONS)}, then `: `: {unnamed[0]}")
|
||||
said[seat.name] = line
|
||||
first, second, *more = (each[-1] for each in counted(seats, said).values())
|
||||
if more and first == second:
|
||||
@@ -38,7 +38,13 @@ def counted(seats: list[Seat], said: dict[str, list[str]]) -> dict[str, list[str
|
||||
|
||||
|
||||
def names_a_place(seat: Seat, dimension: str) -> bool:
|
||||
return any(PLACE.search(place) and (dimension == DIMENSIONS[-1] or re.search(rf"\b{dimension}\b", place)) for place in seat.places)
|
||||
return any(PLACE.search(place) and (dimension == DIMENSIONS[-1] or dimension in place_dimensions(place)) for place in seat.places)
|
||||
|
||||
|
||||
def place_dimensions(place: str) -> list[str]:
|
||||
"""The dimensions a place opens with, as in `Locality, Shape: `path:line` ...`; empty when any name before the first `: ` is no dimension."""
|
||||
named = place.partition(": ")[0].split(", ")
|
||||
return named if all(name in DIMENSIONS for name in named) else []
|
||||
|
||||
|
||||
def ruling(counted: list[str]) -> str | None:
|
||||
|
||||
Reference in New Issue
Block a user