GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - TiltTek/score-sheets: Keep score from a sheet declared per game as data: totals, ranks and tie-breakers computed and explained at each entry, team scores, and a blank sheet to print.

BranchesTags
Open more actions menu

Latest commit

 

History

1 Commit
1 Commit

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
doc
doc
 
 
src
src
 
 
tests
tests
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.fr.md
README.fr.md
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
composer-dependency-analyser.php
composer-dependency-analyser.php
 
 
composer.json
composer.json
 
 
phil-dev.php
phil-dev.php
 
 

Repository files navigation

tilttek/score-sheets

Score sheets declared per game, with categories, totals computed live and tie-breakers, printable blank, and results passed on to the play log.

tilttek/score-sheets keeps the score of a board game the way its sheet does, from a declaration that is data, not code: the categories in order, each entered by the scorer between its bounds or computed from those before it — a sum, a product, points by place for a majority, a simple conditional bonus —, which of them count in the total, and the tie-breakers. The scoreboard is computed again at each entry: every value, every total, the ranks, and the steps that explain each value; team scores are composed of their members' totals, with the detail of the sum.

The sheet of a match is prepared before the players see it, published, filled, and closed; a sheet closed too early is reopened, corrected and closed again, as a new revision. A closed match gives a neutral result — places, totals, teams, revision — and a message with its identifier only, for a play log or a rating to read, without depending on either. A blank sheet to print comes as neutral data: the layout, in HTML or PDF, belongs to the application.

It is for an application that keeps scores at the table — a game night, a tournament, a club's play log. It is a plain PHP library with no dependency.

Status

Part State
SheetDefinition, Category, Tiebreaker: declarations as data, read from JSON and written back Implemented and tested
Operation\*: sum, product, majority and bonus, and their codec Implemented and tested
Entries, Team: participants, teams, and values entered, corrected or erased Implemented and tested
Scoring\*: totals, ranks with tie-breakers, explanations and team scores Implemented and tested
ScoreKeeper, MatchSheet, SheetStatus: prepare, publish, enter, close and reopen a match's sheet Implemented and tested
MatchResult, Placement, Message\MatchResultRecorded: the result passed on Implemented and tested
BlankSheet: the blank sheet to print, as neutral data Implemented and tested
Contract\MatchSheetStore, Store\InMemoryMatchSheetStore: the store port, and the store in memory for tests Implemented and tested
A store on Doctrine DBAL, the HTML or PDF layout of a sheet, a Symfony bundle Not started: adapters of the application, or of a future bundle

Documentation

Document What it covers
Installation Requirements, installing and wiring.
Declaring a sheet Categories, operations, tie-breakers and teams, in JSON or in code.
Scoring Entries, totals, ranks, explanations and team scores.
Match sheets Preparing, publishing, closing and reopening a sheet; versions; the store.
Passing results on The neutral result and its message, for a play log or a rating.
Printing a blank sheet The blank sheet as neutral data.
Extension points What an application gives the library.
Exceptions ScoreSheetsException and its exceptions, with their messages.
Testing The library's tests and its fuzz target.
Reference Every public type, with its role.

Quick start

use Tilttek\ScoreSheets\Entries;
use Tilttek\ScoreSheets\MatchId;
use Tilttek\ScoreSheets\ParticipantId;
use Tilttek\ScoreSheets\ScoreKeeper;
use Tilttek\ScoreSheets\SheetDefinition;

$sheet = SheetDefinition::fromJson(file_get_contents('sheets/lantern-harbor.json'));
$keeper = new ScoreKeeper($store); // your Contract\MatchSheetStore
$match = new MatchId('m-2031');
$ada = new ParticipantId('u-101');
$bo = new ParticipantId('u-102');

$keeper->prepare($match, $sheet, new Entries([$ada, $bo]));
$keeper->publish($match, 0);

$board = $keeper->record($match, 1, $ada, 'boats', 5);   // the scoreboard, computed again
echo $board->participant($ada)->total;

$result = $keeper->close($match, 2);
$bus->dispatch($result->message());                      // the match and the revision only

Requirements

PHP 8.5 or later.

Contributing

Contributions are welcome on the PHIL monorepo: read the contribution guide and the code of conduct. Report a vulnerability privately, as the security policy explains, never in a public issue.

License

MIT, © Philippe Gamache, doing business as Le Gnome Archiviste; a Tilttek project. See LICENSE.

About

Keep score from a sheet declared per game as data: totals, ranks and tie-breakers computed and explained at each entry, team scores, and a blank sheet to print.

Topics

board-gamesleaderboardphpscore-sheetscoringtie-breakerstilttek

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.