DAILY PIG v2026.10.27.1
A one-game-a-day dice door 
alexcorris@outlook.com bbswordle.com @bbswordle for Blue Sky
======================================================================

The classic dice game Pig, played on the original Pig door's screen:
the pig, the die in the grass, the side menu, the die tumbling before it
lands, and OINK! when a one comes up.  Three turns.  Roll as often as
you dare; bank before a one takes the turn away.

Every caller gets ONE game a day, and everybody's game that day is
ranked together: best score wins the day, scores add up over the month
and all-time.  There are NO make-up days and no playing ahead - today
is the only day there is.  Play every day and your streak grows; miss
one and it starts over.

The die is truly random, so nobody can learn a day's rolls on one BBS
and use them on another.

BBSes can play each other through the same league server Daily Blocks
and Daily Yacht use (dbserver version 2026.10.21.1 or later): see
INTERBBS LEAGUES below.


FILES
----------------------------------------------------------------------
dpig    - Linux 64
dpigPI  - Raspberry PI/ARM
dpinW32 - Win 32
dpigW64 - Win 64 

RUNNING
----------------------------------------------------------------------
Exactly like the other daily doors:

  dpig -D<path>DOOR32.SYS        (or DOOR.SYS, DORINFOx.DEF, BBSDEV.DRP)
  dpig -N<node> -S<socket>
  dpig -L                        local mode, asks for a name

Extra switches:

  -U           local mode on Linux: send UTF-8 instead of CP437 so the
               pig looks right in a modern terminal
  -PName       local mode: log in as Name without the prompt (_ = space)
  -TYYYYMMDD   pretend today is that date - for testing only

The door needs ANSI and an 80x24 (or bigger) screen.  Players are
identified by alias (real name if the drop file has no alias).  All
data lives in the directory the executable is in.


DPIG.INI
----------------------------------------------------------------------
  StartDate=YYYYMMDD  first day of play; set automatically on first run.
                      Only the calendar and the scoreboards use it.

  InterBBS=0          1 = take part in an InterBBS league
  LeagueServer=       the league server: host, or host:port
                      you can use bbswordle.com as long as we are going!
  BBSName=            your BBS's name as the other boards will see it

That is all there is: no make-up days, no play-ahead day, no board seed.
The League... lines that appear under the last three are written by the
door when it joins a league.  Do not edit them, and keep a copy of
LeagueKey with your backups.


HOW IT PLAYS
----------------------------------------------------------------------
THE RULES (as the original Pig door played them)
  * Three turns a day.
  * Each turn, roll the die as often as you dare.  Every 2 to 6 is
    added to the turn's points, which are "riding" until you bank.
  * BANK and the riding points are yours; the turn ends.
  * Roll a 1 and the pig says OINK - the riding points are lost and the
    turn ends.
  * Your score for the day is everything you banked.

THE SCREEN is the original door's: the pig over the grass, the die in
its white box, and the side menu with Turn, Score (the points riding on
this turn) and Bank (your total).  The die tumbles for a moment before
it lands.  A one puts the OINK! bubble over the pig until the next roll.
The line along the bottom says what just happened and what to do next.

KEYS
  R  (or ENTER, SPACE)   roll
  B                      bank the points riding on this turn
  H  (or ?)              the rules, in a window over the pig
  S                      today's top scores, in a window (sealed
                         until your game is over - see below)
  A                      about
  M                      sound on/off
  Q  (or ESC)            leave the game for later today, or end it now

The welcome window shows how many have played today and your streak
before the first roll; ESC there leaves without using the day.

SOUND.  M turns ANSI music on for that caller (and it stays on for them
next time): a blip as the die tumbles, a sad little tune for an OINK, a
fanfare for a bank.  It is off until a caller turns it on, because a
terminal without ANSI music shows the notes as text instead.  The music
uses the ESC[N form, as the original Pig door did - in SyncTERM set
ANSI Music to the "ESC[N" (BANSI) style.  Music only ever goes to the
caller; it never appears on the sysop's local screen.


RULES WORTH KNOWING
----------------------------------------------------------------------
* One game a day, and only on the day itself.  There are no make-ups:
  a day that goes by unplayed is gone, and so is the streak.

* The game is on file the moment the welcome window is passed, and
  every roll is decided and written to disk BEFORE the die tumbles on
  screen.  Nobody gets to see a roll twice.

* A dropped call costs nothing.  Hang up, time out, lose the connection
  or have the door killed, and the game waits just as it was, points
  riding and all: the home screen says "unfinished", the calendar shows
  RESUME, and Play picks it up.  Because rolls are saved before they are
  shown, coming back can never undo a one.

* ...but only TODAY.  At midnight an unfinished game ends with what it
  had banked (points still riding are lost), and it shows as "Cut off".

* Q (or ESC) during a game offers both: L leaves it to finish later
  today, E ends it now - the points riding are lost, turns not played
  score nothing, and the day is used.

* TODAY IS SEALED until your own game is over.  Until you have played
  all three turns (or ended the game), nobody shows you a single score
  from today: not the leader, not the score to beat, not the Day board,
  and not the month, all-time or record boards either - they read as if
  today had not been played yet.  You see how MANY have played, never
  what they scored.  So the last caller in has no number to aim at, and
  everyone plays the same game: as well as they dare.  The moment your
  game is over, the day opens: your place, the leader, everything.
  Leaving a game to finish later keeps the day sealed.  In a league the
  seal covers every BBS's scores alike.

* Once you have played, a game still under way shows on the boards with
  its banked score, marked "Playing".

* Equal scores are a tie and share the place: a day can have two
  winners, and both get the win (BBS vs BBS counts it once per BBS).
  Time plays no part.

* A started game counts for the streak.


STREAKS
----------------------------------------------------------------------
A streak is days in a row with a game.  It is alive while you have
played today, or played yesterday and today's game is still waiting -
the home screen reminds you to "keep your streak alive".  The calendar
shows the days you played, the Streaks board ranks everyone's longest
run (and who still has theirs going), and the Records board keeps the
longest streak ever and the longest one going now.


SCOREBOARDS
----------------------------------------------------------------------
  1 Day        ranking for any one day: score and all three turns
               (12, OINK, or - for a turn not played); "=" is a tie
  2 Winners    who won each day of a month, and their best turn
  3 Month      monthly standings (total, days, wins, average, best,
               current streak)
  4 Champs     the champion of every month
  5 All-Time   lifetime standings
  6 Top        the 50 highest single days ever, turn by turn
  7 Streaks    the longest daily play streaks: best run, when it
               ended (or "still going"), the run alive now, days
  8 Records    hall of records - highest day, best single turn, most
               rolls in one turn, longest streak, longest streak going,
               most daily wins, most OINK-free days, best average,
               biggest month, most days played, most OINKs - and the
               caller's own numbers

Left/Right switches board, , and . move through days or months, 1-8
jump straight to a board.  Long lists scroll with Up/Down, PgUp/PgDn,
Home/End.

CALENDAR & STREAK on the main menu shows the month: the days you played
(with your score, and * where you lead the day), today, the days you
missed, your month's numbers and your streak.  ENTER on today plays it;
ENTER on an earlier day opens that day's scoreboard.

YOUR GAMES shows every game the caller has played, newest first, turn
by turn, with their place on that day.


INTERBBS LEAGUES
----------------------------------------------------------------------
Daily Pig uses the league server that Daily Blocks and Daily Yacht use
- the SAME program, on the SAME address and port.  The server keeps a
separate league for each game, so a BBS in the Daily Blocks or Daily
Yacht league is not in the Daily Pig league until its Daily Pig door
joins, and the leagues never mix.

JOINING.  In dpig.ini set

  InterBBS=1
  LeagueServer=their.address.example        (add :port if they say so, bbswordle.com can go here as long as we are up!)
  BBSName=Your BBS Name

and that is it.  The next caller's door says hello, the server signs the
BBS up, and the door notes the league's details in dpig.ini itself.
Use the same BBSName as in your other doors if you like - each game's
league keeps its own list, so there is no clash.

THE SERVER HAS TO BE 2026.10.21.1 OR LATER.  An older league server
does not run a Daily Pig league: the door then says "that league server
is too old for Daily Pig and needs updating" on the home screen and
carries on locally.  (Nothing is signed up on the old server.)

WHEN IT STARTS.  Games from the league's first day on count in the
league, including any this BBS played before it joined.

WHAT CALLERS SEE.  The same as the other doors: the boards open on the
league, each row showing player and BBS; L switches between the league
and this BBS's own scores; B is BBS vs BBS - one line per BBS, ranked
for the month by each BBS's BEST game of each day added up, so a BBS is
not on top just for having the most callers.  BBS names that do not fit
their column lose a leading "The", then are cut.

IF THE SERVER IS DOWN.  The game carries on with what it has; it tries
again five minutes later.  A caller never waits more than a few seconds
on the network.  Scores move when a caller enters the door, comes back
to the menu, opens the scoreboards or finishes a game - at most every
two minutes unless there is a score to post.

CHEATING.  The server checks every game it is sent: each banked turn
has to be something its number of rolls could make (2 to 6 a roll), a
turn lost to a one has to have been rolled, turns come in order, a
finished game has all three, the score has to be exactly what was
banked, and a game has to have been played on its own day.  Anything
else is turned away.  It cannot tell whether the die really fell that
way - every league row shows handle and BBS so odd results can be seen.

Your BBS name is yours once joined: the server gave your door a key
(LeagueKey in dpig.ini) and will not accept the name without it.  Keep
a copy with your backups.  To leave, set InterBBS=0.

MAINTENANCE
----------------------------------------------------------------------
Delete dpig.dat to wipe all scores.  dpig.ini can be deleted too (it is
rewritten with defaults), but on a BBS in a league keep its LeagueKey
line.  Delete dpig.usr to turn the sound off for everyone.  A stale
dpig.lck directory after a crash is harmless; the door takes it over
after three seconds.