Patterns Game

Interactive on-site game threads go here

Patterns Game

Postby g.r.emlin » Wed Aug 20, 2008 3:55 pm

Patterns Game 2.0

Abstract

The Patterns Game is an interactive game played via posts to the Patterns Game topic in the Sudoku Players forum. Although promoted as a game, there is a hidden agenda: a mechanism for generating and cataloging puzzles with interesting properties.

Forward

Patterns Game 2.0 is a continuation of the Patterns Game introduced by JPF, with a twist. This time around the refereeing and accounting is automated by a daemon, g.r.emlin, interacting as a forum member. The goal of the automation, besides being a neat programming exercise, is to take over the mistake-prone and tedious job of accounting, leaving the enjoyable parts to the human participants (assuming g.r.emlin is the only automaton in the game!) Almost all of the nuances of the game outlined below are malleable and open for discussion. The rules are based on JPF's original post.

Ratings

ER ratings are based on Sudoku Explainer 1.2.1 (SE.) Current ERs fall in the range 1.0 through 13.0, with one digit in the tenths position.

Patterns Game ratings are the tuple ER/EP/ED:
  • ER (explainer rating): the higest Sudoku Explainer rating of the methods leading to the puzzle solution
  • EP (pearl rating): the higest Sudoku Explainer rating of the methods leading to the first cell placement
  • ED (diamond rating): the higest Sudoku Explainer rating of the methods leading to the first candidate elimination

Ratings sort numerically from left to right, low to high. A pearl or diamond must have ER > 2.3.

A modified Sudoku Explainer 1.2.1 determines these ratings. (Note that some browsers may incorrectly change .jar suffixes to .zip when downloading; change the suffix back to .jar before using.) This version contains the standard SudokuExplainer entry point, but also provides a new command line entry point serate. See serate(1) for details. Use --format=%r/%p/%d to generate Patterns Game ratings. serate also works around anomalous java floating point representations by rounding all ratings to the tenths digit.

For this version of SudokuExplainer the rating 0.0 denotes puzzle input/initialization error and the rating 20.0 denotes either multiple solutions or a puzzle requiring unsupported methods.

The Game

For each game a dealer posts a 9x9 sudoku puzzle (the pattern) with the following properties:
  • valid (by definition, but stated for completeness) (gsf-solver -e valid)
  • minimal (gsf-solver -e minimal==1)
  • 2 <= dihedral symmetry order <= 8 (gsf-solver -e 'symmetry>=2&&symmetry<=8')
  • maximum dihedral symmetry order (no puzzle permutation has a higher dihedral symmetry order; must be: gsf-solver -qFN -f%#sc puzzle | gsf-solver -qFN -f'%(S)x')
  • solvable by singles only (gsf-solver -qFN-G)
  • 19 <= clues <= 29 (gsf-solver -e 'clues>=19&&clues<=29')
  • clue pattern not isomorphic to (essentially different from) any previous pattern (gsf-solver -f%#xc)

Each player can post (submit) a new puzzle with the following properties:
  • valid
  • same pattern
  • minimal
  • not isomorphic to any previous puzzle in the current game
  • different ER from any previous puzzle in the current game or an ER/EP/ED greater than the highest submitted ER/EP/ED with the same ER by another player (a trump); trumping ones own entry (a self-trump) is not allowed

Rules

The dealer is selected by the referee (see below.) After making a submission a player may not make another submission until 10 minutes have passed and another player has made a submission. Game numbers 0 modulo 2 are lightning rounds (marked LIGHTNING) with the 10 minutes submission delay waived. In checking for consecutive posts by the same player, a syntactically correct submission is considered a submission, even if it is later tagged invalid. A duplicate submission within 2 minutes of the original submission is ignored (unless the duplicate is by the same player.) Within 5 minutes of an invalid submission the referee will post an ::: adjustment ::: message that contains the sumbmission date and reason for the adjustment.

The current game closes when any of the following occur:
  • all but one of the active players (players who have made submissions) have resigned
  • no valid submissions have been made for
    • < 4 players: (4 days + 2 hours)
    • >= 4 players: (22 hours + 2 hours)

Scoring

The points for each submission is the ordinal of the submission: 1 point for the dealer, 2 points for the second submission, etc.

When the game closes all of the points are summed, per-player, with the following adjustments:
  • add -20 for the dealer
  • add submission ordinal for the last submission
  • add submission ordinal plus 10% of the total score at the time of entry for the highest ER/EP/ED
  • add submission ordinal plus 5% of the current total score for the last entry
  • assign -50 for each invalid submission
  • assign -50 for each submission marked edited
  • assign -100 for each submission with ER/EP/ED that does not match the results of Sudoku Explainer 1.2.1
  • assign -50 for each self-trump
  • assign 0 for trumped submissions
  • add EP/ED bonus of (5*(EP-2.3)+10*(ED-2.3))
  • (25*(2-count+1)) for each non-trumped entry with ER/EP/ED count (from all previous games) <= 2
  • (10*(2-count+1)) for each trumped entry with ER/EP/ED count (from all previous games) <= 2
  • 0 plus EP/ED bonus of (SCORE_MORE?1:0)*(5*(EP-2.3)+10*(ED-2.3)) for each ::: more ::: puzzle (see below) posted in the time between the game close and the next game start

where assign means the submission only gets the assigned points (and does not participate in any other bonus scoring or labeling) and add means the points are added to the submission points. Trumped rarity bonuses are retained by the original submitter. The player with the highest point total is the winner.

Submissions

Puzzle submission posts must be in 9x9 grid form with the ER/EP/ED ratings as ED=floating-point-number/floating-point-number/floating-point-number, EP=floating-point-number/floating-point-number/floating-point-number, or ER=floating-point-number/floating-point-number/floating-point-number, but no other adornments. As of Patterns Game 2.0 all three ratings must accompany a submission. The grid and rating must be in a [ code ] ... [ /code ] block with no font size/color adornments. Signature and other text may follow the code block.

Any player can request game status with a post containing ::: status ::: on a separate line. The referee posts status every 10 submissions, so this may be needed only when the game slows.

A player can resign with a post containing ::: resign ::: on a separate line. Resigned players cannot make submissions to the current game.

A resigned player can re-sign with a post containing ::: re-sign ::: on a separate line.

After the game is closed and before the next game starts players may post a batch of additional valid but unplayable puzzles for the closed game:
Code: Select all
::: more :::
81-char-grid  ER/EP/ED
   ...

Unplayable puzzles include those cached by the last player and puzzles with a higher ER/EP/ED of an entry by the same player.

Use ::: comment ::: as the first line of a post that might otherwise be interpreted as a sumbission. This often happens when quoting or referring to submissions in the current or previous games.

::: patterns ::: on a separate line will list the patterns for all previous games.

A post containing ::: anything ::: before any font embellishments will not be interpreted as a submission.

The edited score adjustment does not apply to more messages.

The Dealer

The referee maintains a queue of candidate patterns. This queue is not perused by any of the players, even g.r.emlin's close friends. The queue contains a handful of generated puzzles just in case player candidates run dry. Players may submit one or more puzzles to the queue via a private message to g.r.emlin with the subject pattern and the message containing one or more lines of the form
Code: Select all
81-char-grid  ED=floating-point-number/floating-point-number/floating-point-number

A reply is sent for each pattern submission with either queued or rejected in the subject line. The message body will contain a reason for the rejection; there may be more than one reason, but the validation stops at the first invalid property detected. Messages with subjects other than exactly pattern are silently discarded. Except for the start state the referee private message inbox is checked every 2 hours.

Dealer submissions are maintained FIFO per dealer, and dealers are selected round robin. A dealer repeats in succession only if there are no dealer submissions from other players. If there are no player submissions in the queue then g.r.emlin selects one from a pre-generated list and it's your fault if its not a good game. Don't bombard the queue -- submissions, including yours, might be silently discarded.

The dealer selection for the next game is made when the game enters the start state. Dealer submissions made after the start state will be eligible for subsequent games.

Etiquette

It's OK to try to fool the referee up to a point (i.e., don't do things that would get you kicked off the forum or that you would be embarrassed to tell your mom.) It just becomes part of the debugging process.

It is definitely bad form for a dealer to cache entries before a puzzle is dealt. However, doing a trial run to check on the quality of a deal is fine, as long as the trial data is not used for game play.

Game States

The game is modeled as a state machine with submissions and elapsed time controling the transitions. All times are UTC (zulu). No provisions are made for waking/sleeping hours across time zones. The progression of games will eventually wash any time zone specific bias.

The states are:
  • start: The referee selects a dealer and posts a message that the game will start in 16 hours.
  • open: The referee posts the pattern and dealer id, and the game begins. A status message is posted after every 10 submissions.
  • idle: After at least 3 entries have been made (the deal counts as entry 1) and 22 hours with no submissions (4 days if < 4 players) the referee posts a message that the game has gone idle and will close in 2 hours if there are no further submissions. If there is a submission within 2 hours the game goes back to the open state.
  • closed: After (22 hours + 2 hours) (or (4 days + 2 hours) if < 4 players) idle, or when all but one of the active players have resigned, the referee posts a message that the game is closed. This message will include preliminary results. Players may post one or more ::: more ::: messages containing grids found after the game closed.
  • final: (2 days+16 hours - 5 minutes) after closing the game enters the final state and the referee posts a final tally for the game that includes all scores and submitted puzzles. Once a game is final any edited submissions for the game are ignored. After 5 minutes the next game enters the start state.

Status

The status listing contains the current maximum ER/EP/ED with submitter for each active ER, along with the current score and adjustment notes for each active player. The referee also keeps a count of ER and ER/EP/ED from all previous games. A rare ER has a count <= 5 and a rare ER/EP/ED has a count <= 2. Starting with game 132 more entries are excluded from the rarity count.

Under the Hood

The automaton and this documentation are configured by the following script:
Code: Select all
# game configuration

typeset FORUM="Sudoku Players"          # forum name
typeset TITLE="Patterns Game"           # title
typeset RESULTS="Results"               # final results topic
typeset VERSION=2.0                     # version
typeset DAEMON=g.r.emlin                # daemon id

typeset solver=g                        # gsf command line solver
typeset solver_name="gsf-solver"        # solver name
typeset solver_version=2008-03-12       # oldest compatible solver version
typeset solver_url=http://www.research.att.com/~gsf/sudoku/                             # solver url

typeset se=se                           # SE command line rater
typeset se_ED=-f%r/%p/%d                # SE ER/EP/ED options
typeset SE_NAME="Sudoku Explainer"      # SE name
typeset SE_VERSION=1.2.1                # oldest compatible SE version
typeset SE_URL=http://diuf.unifr.ch/people/juillera/Sudoku/Sudoku.html                  # SE url
typeset SE_RATE_URL=http://gsf.cococlyde.org/download/sudoku/SudokuExplainer.jar         # SE rate url
typeset SE_RATE_MAN=http://gsf.cococlyde.org/download/sudoku/serate.html               # SE rate man page
typeset RATING="ER/EP/ED"               # rating label

typeset BONUSES=bonuses                 # submission bonus file
typeset CANDIDATES=candidates           # candidate pattern file
typeset ENTRIES=entries                 # valid submission file
typeset PATTERNS=patterns               # dealt pattern file
typeset PENALTIES=penalties             # submission penalty file
typeset RATINGS=ratings                 # current ratings file
typeset SCORES=scores                   # current scores file

typeset CONTROL_PREFIX=:::              # post control line prefix
typeset CONTROL_SUFFIX=:::              # post control line suffix

typeset GENERATE=1000.100.60.30         # guesstimate solver -gtp N.R.F.S generation parameters
typeset HITS_MAX=20                     # max hits for a "good pattern" in $GENERATE window
typeset AGENT_GENERATE=10000.100.60.30  # agent solver -gtp N.R.F.S generation parameters
typeset AGENT_HITS=10                   # agent per-solver -n generation limit
typeset AGENT_NPROC=2                   # agent new game active process id limit
typeset AGENT_REMOTE_NPROC=8            # agent new game remote search process limit

integer AGENT_SLEEP=1                   # agent bedtime hour
integer AGENT_WAKE=9                    # agent wake hour
integer AGENT_WAIT_SUBMIT=15*minutes    # agent wait time before next move (beyond WAIT_SUBMIT)
integer AGENT_WAIT_OPPONENT=30*minutes  # agent wait time after next opponent (randomized max)

typeset CONSTRAINTS="singles only"      # must be solvable by these constraints
typeset CONSTRAINTS_EXPR=FN-G           # solver -q solvable constraints

integer QUORUM=4                        # minimum amount of players to enable idling
integer LIGHTNING=2                     # lightning round frequency
integer CLUES_MIN=19                    # minimum number of clues
integer CLUES_MAX=29                    # maximum number of clues
integer SYMMETRY_MIN=2                  # minimum dihedral symmetry order
integer SYMMETRY_MAX=8                  # maximum dihedral symmetry order
integer IDLE_ENTRIES=3                  # no idle until this many entries

float   RATING_MIN=1.0                  # minimum ER
float   RATING_MAX=13.0                 # maximum ER

typeset ISER="?(1)[0-9].[0-9]"          # valid ER pattern
typeset ISED="$ISER/$ISER/$ISER"        # valid ER/EP/ED pattern

integer RARE_ER=5                       # rare ER count (of all previous games)
integer RARE_ED=2                       # rare ER/EP/ED count (of all previous games)

# 0 for any SCORE_* value disables that bonus/penalty #

integer SCORE_CONSECUTIVE=-50           # consecutive entry adjustment
integer SCORE_DEAL=-20                  # dealer adjustment
integer SCORE_ERROR=-50                 # invalid/edited entry adjustment
integer SCORE_NOSE=-100                 # invalid SE ER/EP/ED rating adjustment
integer SCORE_HIGHEST=0                 # highest ER/EP/ED rating adjustment
integer SCORE_HIGHEST_PERCENT=10        # % of total at submission time for highest ER/EP/ED rating
integer SCORE_LAST=0                    # last entry adjustment
integer SCORE_LAST_PERCENT=5            # % of total at submission time for last entry
integer SCORE_MORE=0                    # ::: more ::: per entry adjustment
integer SCORE_PREMATURE=-50             # premature entry adjustment
integer SCORE_TIE=0                     # tie entry adjustment
integer SCORE_RARE_ED=25                # rare ER/EP/ED rating bonus (maybe 0?)
integer SCORE_TRUMPED_RARE_ED=10        # trumped rare ER/EP/ED rating bonus (maybe 0?)
integer SCORE_SELF=-50                  # self trump adjustment

typeset SCORE_PD="(5*(EP-2.3)+10*(ED-2.3))"     # pearl/diamond bonus

integer ENTRY_STATUS=10                 # status after this many entries

integer WAIT_CLOSED=2*hours             # idle->closed transition interval
integer WAIT_IDLE=22*hours              # open->idle transition interval
integer WAIT_IDLE_NOQUORUM=4*days       # no quorum open->idle transition interval
integer WAIT_MAIL=2*hours               # referee private message poll interval
integer WAIT_NEXT=10*minutes            # next game poll interval
integer WAIT_OPEN=16*hours              # start->open transition interval
integer WAIT_POLL=5*minutes             # referee status poll interval
integer WAIT_POST=2*minute              # time between forum posts
integer WAIT_ROUND=60*minutes           # announced event time rounding
integer WAIT_START=2*days+16*hours      # closed->start transition interval
integer WAIT_SUBMIT=10*minutes          # minimum submission interval
integer WAIT_TIE=2*minutes              # player tie entry window

# christmas holiday suspension #

# SCORE_CONSECUTIVE=0
# SCORE_PREMATURE=0
# SCORE_SELF=0
# WAIT_IDLE=22*days
# WAIT_SUBMIT=1*minute


g.r.emlin powered by ksh (and mm!)
User avatar
g.r.emlin
Moderator
 
Posts: 11580
Joined: 07 December 2007
Location: www

Postby g.r.emlin » Thu Aug 21, 2008 2:01 am

::: adjustment :::
Code: Select all
2008-08-20+12:30:00-0000 m_b_metcalf bad-submission -50
User avatar
g.r.emlin
Moderator
 
Posts: 11580
Joined: 07 December 2007
Location: www

Postby gsf » Thu Aug 21, 2008 2:07 am

::: comment :::
this is a continuation of game 0047 from the old Patterns Game 1.5 forum thread
Last edited by gsf on Thu Aug 21, 2008 7:44 am, edited 1 time in total.
gsf
2014 Supporter
 
Posts: 7306
Joined: 21 September 2005
Location: NJ USA

Postby gsf » Thu Aug 21, 2008 3:55 am

Code: Select all
. . 1 . . 2 . . 3
. 4 . . . . . 5 .
6 . . . 7 . 8 . .
. . . 1 . 3 . . 2
. . 3 . . . 5 . .
2 . . 5 . 7 . . .
. . 5 . 1 . . . 8
. 9 . . . . . 4 .
7 . . 8 . . 6 . .  ED=7.3/7.3/7.3
gsf
2014 Supporter
 
Posts: 7306
Joined: 21 September 2005
Location: NJ USA

Postby m_b_metcalf » Thu Aug 21, 2008 5:02 am

Code: Select all
 . . 1 . . 2 . . 3
 . 4 . . . . . 5 .
 6 . . . 7 . 4 . .
 . . . 8 . 3 . . 6
 . . 8 . . . 2 . .
 5 . . 7 . 9 . . .
 . . 4 . 9 . . . 1
 . 9 . . . . . 6 .
 7 . . 2 . . 8 . .   ED=8.9/8.9/8.9

Regards,

Mike Metcalf
User avatar
m_b_metcalf
2017 Supporter
 
Posts: 13622
Joined: 15 May 2006
Location: Berlin

Postby Pat » Thu Aug 21, 2008 10:17 am

the "bad-submission" (missing "ED=") was penalized -- but presumably accepted, else gsf would've had to wait before his next post.
    still, would be good to see this explicitly in the status -- no status suggests another crash?
User avatar
Pat
 
Posts: 4056
Joined: 18 July 2005

Postby gsf » Thu Aug 21, 2008 10:53 am

Code: Select all
. . 1 . . 2 . . 3
. 4 . . . . . 5 .
6 . . . 7 . 8 . .
. . . 1 . 3 . . 7
. . 3 . . . 9 . .
7 . . 6 . 9 . . .
. . 8 . 1 . . . 5
. 5 . . . . . 4 .
9 . . 2 . . 6 . .  ED=9.2/9.2/9.2
gsf
2014 Supporter
 
Posts: 7306
Joined: 21 September 2005
Location: NJ USA

Postby m_b_metcalf » Thu Aug 21, 2008 11:14 am

Code: Select all
 . . 1 . . 2 . . 3
 . 4 . . . . . 5 .
 5 . . . 6 . 2 . .
 . . . 7 . 3 . . 6
 . . 3 . . . 8 . .
 6 . . 4 . 8 . . .
 . . 9 . 7 . . . 1
 . 1 . . . . . 7 .
 8 . . 9 . . 5 . .   ED=8.4/8.4/8.4

Regards,

Mike Metcalf
User avatar
m_b_metcalf
2017 Supporter
 
Posts: 13622
Joined: 15 May 2006
Location: Berlin

Postby gsf » Thu Aug 21, 2008 11:26 am

::: comment :::
Pat wrote:the "bad-submission" (missing "ED=") was penalized -- but presumably accepted, else gsf would've had to wait before his next post.
    still, would be good to see this explicitly in the status -- no status suggests another crash?

this is a difficult part of the rules
if the invalid entries are not accepted as a turn then an unscrupulous player
could post optical illusions that might lull other players into playing out of turn

this missing ::: status ::: is due to a manual state sync from the crashed machine
that had the referee thinking the status had already been posted

since there have been a few entries since then another ::: status ::: should work now
gsf
2014 Supporter
 
Posts: 7306
Joined: 21 September 2005
Location: NJ USA

Postby m_b_metcalf » Thu Aug 21, 2008 11:38 am

::: status :::
User avatar
m_b_metcalf
2017 Supporter
 
Posts: 13622
Joined: 15 May 2006
Location: Berlin

Postby Pat » Thu Aug 21, 2008 11:42 am

thanks for clarifying
    so he should re-post his "bad" puzzle at his next turn
User avatar
Pat
 
Posts: 4056
Joined: 18 July 2005

Postby g.r.emlin » Thu Aug 21, 2008 11:42 am

::: game 0047 status :::
Code: Select all
game 0047 2008-08-20+09:20:00-0000 duration 1d01h dealer Mauricio page 1 (open) 3 players
________________________________________________________________________________________________________

    1.2/1.2/1.2 Mauricio       7.3/7.3/7.3 gsf            8.4/8.4/8.4 m_b_metcalf    9.3/9.3/2.6 gsf
    1.7/1.7/1.7 gsf            7.8/7.8/7.8 m_b_metcalf    8.9/8.9/8.9 m_b_metcalf
    3.4/3.4/2.6 m_b_metcalf    8.3/8.3/8.3 gsf            9.2/9.2/9.2 gsf
________________________________________________________________________________________________________

       submitter  entries  score  response  notes
     -----------  -------  -----  --------  -----
        Mauricio        1    -19         0  dealer
     m_b_metcalf        4    268    32m14s  diamond*3,pearl,last-entry,bad-submission
             gsf        5    339     4h44m  diamond*3,pearl,highest-rating
     -----------  -------  -----            -----
               3       10    588            diamond*6,pearl*2
User avatar
g.r.emlin
Moderator
 
Posts: 11580
Joined: 07 December 2007
Location: www

Postby gsf » Thu Aug 21, 2008 11:45 am

Pat wrote:thanks for clarifying
    so he should re-post his "bad" puzzle at his next turn

yes, as long as it wasn't snapped up by another player
gsf
2014 Supporter
 
Posts: 7306
Joined: 21 September 2005
Location: NJ USA

game 47 -- 9.1

Postby Pat » Thu Aug 21, 2008 12:07 pm

Code: Select all
 . . 1 . . 2 . . 3
 . 3 . . . . . 4 .
 5 . . . 6 . 7 . .
 . . . 2 . 8 . . 4
 . . 7 . . . 8 . .
 8 . . 5 . 1 . . .
 . . 5 . 1 . . . 7
 . 9 . . . . . 8 .
 3 . . 9 . . 6 . .          ED=9.1/9.1/2.6



you mean like this?
User avatar
Pat
 
Posts: 4056
Joined: 18 July 2005

Postby m_b_metcalf » Thu Aug 21, 2008 12:10 pm

Code: Select all
 . . 1 . . 2 . . 3
 . 3 . . . . . 4 .
 5 . . . 6 . 7 . .
 . . . 2 . 8 . . 9
 . . 7 . . . 8 . .
 8 . . 5 . 1 . . .
 . . 5 . 1 . . . 7
 . 9 . . . . . 8 .
 3 . . 9 . . 6 . .  ED=9.4/9.4/2.6

No, like this...

Regards,

Mike Metcalf
User avatar
m_b_metcalf
2017 Supporter
 
Posts: 13622
Joined: 15 May 2006
Location: Berlin

Next

Return to Interactive games