Skip to content

Simple scoreboard for sharing Wordle (or similar styled game) scores with friends

Notifications You must be signed in to change notification settings

TheDecimeter/WordleScoreBoard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WordleScoreBoard

Extremely simple scoreboard I put together for family. It was a reasonable success so I figured I'd share it publicly incase anyone else wanted to use it on their own personal server. This is not meant for any wide spread use. There is no player validation built in. This is really only good for a local group of friends who trust each other.

Uses file system to store data, not a database. So any server with php should be able to handle this with next to no setup.

This is meant to be on a secret url between yourself and your friends. But you may still wish to disable PHP execution in the 'grids' folder if your server can execute non ".php" files.

Setup Steps:

  • Delete the h.txt file from the grids folder
  • OPTIONAL Create a values.js file (not needed for classic wordle).
    • This file can specify fields to anchor a score grid's data to the correct dates
      • window.firstDay = a number indicating the first grid of a week (eg: 951)
      • window.firstDate = a string representing the above number's date (eg: "8/07/2023")
      • window.timesPerDay = a number representing the times per day the game is played (eg, Wordle would be 1, Phrazle might be 2)
      • window.validateGrid = a function returning true if a grid is valid. Two arguments are provided, the grid and the stats line. (eg, (g,s) => !s.includes("Wordle"); would not submit a grid if it contains the word "Wordle" in it's stats line)
      • window.gridClean = a function to clean a cleaned up grid string (eg, (g,s) => g.replace("\n#phrazle\n", ""); can remove some clutter from a phrazle grid)
    • There are also a couple ids easy to add to
      • document.getElementById("preInstruction") a span prior to the submit area
      • document.getElementById("postInstruction") a span after to the submit area

Example "values.js" for Phrazle Grids from https://solitaired.com/phrazle (WARNING: solitaired does not properly adjust with daylight savings time. So the below configuration will likely be incorrect. Also, this means on the week after daylights saving time, you will have to create a new instance with updated values.js. Other games (like nytimes' wordle seem to handle daylight savings time just fine)

window.firstDay = 951;
window.firstDate = "8/07/2023";
window.timesPerDay = 2;
document.title = "Phrazle Board"
/**
 * @param {string} grid - whole grid
 * @param {string} stats - stats line
 * @returns true if grid is to be submitted
 */
window.validateGrid = (grid, stats) => {
    if (stats.includes("Wordle"))
        return window.confirm("This might be a wordle grid, not Phrazle. Are you sure you wish to submit?");
    return true;
}

About

Simple scoreboard for sharing Wordle (or similar styled game) scores with friends

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published